mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
test: rename (meths, funcs) -> (api, fn)
This commit is contained in:
@@ -4,9 +4,9 @@ local assert_alive = helpers.assert_alive
|
||||
local clear, feed = helpers.clear, helpers.feed
|
||||
local eval, eq, neq = helpers.eval, helpers.eq, helpers.neq
|
||||
local feed_command, source, expect = helpers.feed_command, helpers.source, helpers.expect
|
||||
local funcs = helpers.funcs
|
||||
local fn = helpers.fn
|
||||
local command = helpers.command
|
||||
local meths = helpers.meths
|
||||
local api = helpers.api
|
||||
local poke_eventloop = helpers.poke_eventloop
|
||||
|
||||
describe('completion', function()
|
||||
@@ -820,23 +820,23 @@ describe('completion', function()
|
||||
end)
|
||||
|
||||
it('provides completion from `getcompletion()`', function()
|
||||
eq({ 'vim' }, funcs.getcompletion('vi', 'lua'))
|
||||
eq({ 'api' }, funcs.getcompletion('vim.ap', 'lua'))
|
||||
eq({ 'tbl_filter' }, funcs.getcompletion('vim.tbl_fil', 'lua'))
|
||||
eq({ 'vim' }, funcs.getcompletion('print(vi', 'lua'))
|
||||
eq({ 'vim' }, fn.getcompletion('vi', 'lua'))
|
||||
eq({ 'api' }, fn.getcompletion('vim.ap', 'lua'))
|
||||
eq({ 'tbl_filter' }, fn.getcompletion('vim.tbl_fil', 'lua'))
|
||||
eq({ 'vim' }, fn.getcompletion('print(vi', 'lua'))
|
||||
-- fuzzy completion is not supported, so the result should be the same
|
||||
command('set wildoptions+=fuzzy')
|
||||
eq({ 'vim' }, funcs.getcompletion('vi', 'lua'))
|
||||
eq({ 'vim' }, fn.getcompletion('vi', 'lua'))
|
||||
end)
|
||||
end)
|
||||
|
||||
it('cmdline completion supports various string options', function()
|
||||
eq('auto', funcs.getcompletion('set foldcolumn=', 'cmdline')[2])
|
||||
eq({ 'nosplit', 'split' }, funcs.getcompletion('set inccommand=', 'cmdline'))
|
||||
eq({ 'ver:3,hor:6', 'hor:', 'ver:' }, funcs.getcompletion('set mousescroll=', 'cmdline'))
|
||||
eq('BS', funcs.getcompletion('set termpastefilter=', 'cmdline')[2])
|
||||
eq('SpecialKey', funcs.getcompletion('set winhighlight=', 'cmdline')[1])
|
||||
eq('SpecialKey', funcs.getcompletion('set winhighlight=NonText:', 'cmdline')[1])
|
||||
eq('auto', fn.getcompletion('set foldcolumn=', 'cmdline')[2])
|
||||
eq({ 'nosplit', 'split' }, fn.getcompletion('set inccommand=', 'cmdline'))
|
||||
eq({ 'ver:3,hor:6', 'hor:', 'ver:' }, fn.getcompletion('set mousescroll=', 'cmdline'))
|
||||
eq('BS', fn.getcompletion('set termpastefilter=', 'cmdline')[2])
|
||||
eq('SpecialKey', fn.getcompletion('set winhighlight=', 'cmdline')[1])
|
||||
eq('SpecialKey', fn.getcompletion('set winhighlight=NonText:', 'cmdline')[1])
|
||||
end)
|
||||
|
||||
describe('from the commandline window', function()
|
||||
@@ -882,8 +882,8 @@ describe('completion', function()
|
||||
return ''
|
||||
endfunction
|
||||
]])
|
||||
meths.nvim_set_option_value('completeopt', 'menuone,noselect', {})
|
||||
meths.nvim_set_var('_complist', {
|
||||
api.nvim_set_option_value('completeopt', 'menuone,noselect', {})
|
||||
api.nvim_set_var('_complist', {
|
||||
{
|
||||
word = 0,
|
||||
abbr = 1,
|
||||
@@ -927,7 +927,7 @@ describe('completion', function()
|
||||
end)
|
||||
|
||||
it('CompleteChanged autocommand', function()
|
||||
meths.nvim_buf_set_lines(0, 0, 1, false, { 'foo', 'bar', 'foobar', '' })
|
||||
api.nvim_buf_set_lines(0, 0, 1, false, { 'foo', 'bar', 'foobar', '' })
|
||||
source([[
|
||||
set complete=. completeopt=noinsert,noselect,menuone
|
||||
function! OnPumChange()
|
||||
|
||||
Reference in New Issue
Block a user