aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/oldfiles_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ex_cmds/oldfiles_spec.lua')
-rw-r--r--test/functional/ex_cmds/oldfiles_spec.lua22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/functional/ex_cmds/oldfiles_spec.lua b/test/functional/ex_cmds/oldfiles_spec.lua
index 11bebb3793..8d1469f343 100644
--- a/test/functional/ex_cmds/oldfiles_spec.lua
+++ b/test/functional/ex_cmds/oldfiles_spec.lua
@@ -4,7 +4,7 @@ local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local command = helpers.command
local expect_exit = helpers.expect_exit
-local buf, eq, feed_command = helpers.curbufmeths, helpers.eq, helpers.feed_command
+local api, eq, feed_command = helpers.api, helpers.eq, helpers.feed_command
local feed, poke_eventloop = helpers.feed, helpers.poke_eventloop
local ok = helpers.ok
local eval = helpers.eval
@@ -42,7 +42,7 @@ describe(':oldfiles', function()
feed_command('edit testfile2')
feed_command('wshada')
feed_command('rshada!')
- local oldfiles = helpers.meths.get_vvar('oldfiles')
+ local oldfiles = api.nvim_get_vvar('oldfiles')
feed_command('oldfiles')
screen:expect([[
|
@@ -56,11 +56,11 @@ describe(':oldfiles', function()
it('can be filtered with :filter', function()
feed_command('edit file_one.txt')
- local file1 = buf.get_name()
+ local file1 = api.nvim_buf_get_name(0)
feed_command('edit file_two.txt')
- local file2 = buf.get_name()
+ local file2 = api.nvim_buf_get_name(0)
feed_command('edit another.txt')
- local another = buf.get_name()
+ local another = api.nvim_buf_get_name(0)
feed_command('wshada')
feed_command('rshada!')
@@ -95,9 +95,9 @@ describe(':browse oldfiles', function()
before_each(function()
_clear()
feed_command('edit testfile1')
- filename = buf.get_name()
+ filename = api.nvim_buf_get_name(0)
feed_command('edit testfile2')
- filename2 = buf.get_name()
+ filename2 = api.nvim_buf_get_name(0)
feed_command('wshada')
poke_eventloop()
_clear()
@@ -108,7 +108,7 @@ describe(':browse oldfiles', function()
-- Ensure v:oldfiles isn't busted. Since things happen so fast,
-- the ordering of v:oldfiles is unstable (it uses qsort() under-the-hood).
-- Let's verify the contents and the length of v:oldfiles before moving on.
- oldfiles = helpers.meths.get_vvar('oldfiles')
+ oldfiles = helpers.api.nvim_get_vvar('oldfiles')
eq(2, #oldfiles)
ok(filename == oldfiles[1] or filename == oldfiles[2])
ok(filename2 == oldfiles[1] or filename2 == oldfiles[2])
@@ -123,16 +123,16 @@ describe(':browse oldfiles', function()
it('provides a prompt and edits the chosen file', function()
feed('2<cr>')
- eq(oldfiles[2], buf.get_name())
+ eq(oldfiles[2], api.nvim_buf_get_name(0))
end)
it('provides a prompt and does nothing on <cr>', function()
feed('<cr>')
- eq('', buf.get_name())
+ eq('', api.nvim_buf_get_name(0))
end)
it('provides a prompt and does nothing if choice is out-of-bounds', function()
feed('3<cr>')
- eq('', buf.get_name())
+ eq('', api.nvim_buf_get_name(0))
end)
end)