aboutsummaryrefslogtreecommitdiff
path: root/test/functional/shada/marks_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/shada/marks_spec.lua')
-rw-r--r--test/functional/shada/marks_spec.lua20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/functional/shada/marks_spec.lua b/test/functional/shada/marks_spec.lua
index b03af39662..955a6f382b 100644
--- a/test/functional/shada/marks_spec.lua
+++ b/test/functional/shada/marks_spec.lua
@@ -15,15 +15,15 @@ local nvim_current_line = function()
end
describe('ShaDa support code', function()
- testfilename = 'Xtestfile-functional-shada-marks'
- testfilename_2 = 'Xtestfile-functional-shada-marks-2'
+ local testfilename = 'Xtestfile-functional-shada-marks'
+ local testfilename_2 = 'Xtestfile-functional-shada-marks-2'
before_each(function()
reset()
local fd = io.open(testfilename, 'w')
fd:write('test\n')
fd:write('test2\n')
fd:close()
- local fd = io.open(testfilename_2, 'w')
+ fd = io.open(testfilename_2, 'w')
fd:write('test3\n')
fd:write('test4\n')
fd:close()
@@ -90,6 +90,16 @@ describe('ShaDa support code', function()
eq(2, nvim_current_line())
end)
+ it('is able to dump and read back mark "', function()
+ nvim_command('edit ' .. testfilename)
+ nvim_command('2')
+ nvim_command('qall')
+ reset()
+ nvim_command('edit ' .. testfilename)
+ nvim_command('normal! `"')
+ eq(2, nvim_current_line())
+ end)
+
it('is able to populate v:oldfiles', function()
nvim_command('edit ' .. testfilename)
local tf_full = curbufmeths.get_name()
@@ -98,13 +108,15 @@ describe('ShaDa support code', function()
nvim_command('qall')
reset()
local oldfiles = meths.get_vvar('oldfiles')
+ table.sort(oldfiles)
eq(2, #oldfiles)
eq(testfilename, oldfiles[1]:sub(-#testfilename))
eq(testfilename_2, oldfiles[2]:sub(-#testfilename_2))
eq(tf_full, oldfiles[1])
eq(tf_full_2, oldfiles[2])
nvim_command('rshada!')
- local oldfiles = meths.get_vvar('oldfiles')
+ oldfiles = meths.get_vvar('oldfiles')
+ table.sort(oldfiles)
eq(2, #oldfiles)
eq(testfilename, oldfiles[1]:sub(-#testfilename))
eq(testfilename_2, oldfiles[2]:sub(-#testfilename_2))