aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/runtime_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-01-26 10:58:03 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-01-26 11:55:34 +0800
commit62f09017e09b7dc7bc837b0b13d9f1598685be46 (patch)
treef25bc50ff763a3d31cbd43a528b1e391720ac136 /test/functional/lua/runtime_spec.lua
parentebc80dcded59b3b9de147091395f7570066fb00c (diff)
downloadrneovim-62f09017e09b7dc7bc837b0b13d9f1598685be46.tar.gz
rneovim-62f09017e09b7dc7bc837b0b13d9f1598685be46.tar.bz2
rneovim-62f09017e09b7dc7bc837b0b13d9f1598685be46.zip
test: add test for :runtime completion for .lua
Diffstat (limited to 'test/functional/lua/runtime_spec.lua')
-rw-r--r--test/functional/lua/runtime_spec.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/functional/lua/runtime_spec.lua b/test/functional/lua/runtime_spec.lua
index b659f2eacb..884ef3ef8e 100644
--- a/test/functional/lua/runtime_spec.lua
+++ b/test/functional/lua/runtime_spec.lua
@@ -18,6 +18,7 @@ describe('runtime:', function()
io.open(init, 'w'):close() -- touch init file
clear{args = {'-u', init}}
exec('set rtp+=' .. plug_dir)
+ exec('set completeslash=slash')
end)
teardown(function()
@@ -42,6 +43,7 @@ describe('runtime:', function()
write_file(colorscheme_file, [[vim.g.lua_colorscheme = 1]])
eq({'new_colorscheme'}, funcs.getcompletion('new_c', 'color'))
+ eq({'colors/new_colorscheme.lua'}, funcs.getcompletion('colors/new_c', 'runtime'))
exec('colorscheme new_colorscheme')
@@ -71,6 +73,7 @@ describe('runtime:', function()
write_file(compiler_file, [[vim.b.lua_compiler = 1]])
eq({'new_compiler'}, funcs.getcompletion('new_c', 'compiler'))
+ eq({'compiler/new_compiler.lua'}, funcs.getcompletion('compiler/new_c', 'runtime'))
exec('compiler new_compiler')
@@ -100,6 +103,7 @@ describe('runtime:', function()
write_file(ftplugin_file , [[vim.b.lua_ftplugin = 1]])
eq({'new-ft'}, funcs.getcompletion('new-f', 'filetype'))
+ eq({'ftplugin/new-ft.lua'}, funcs.getcompletion('ftplugin/new-f', 'runtime'))
exec [[set filetype=new-ft]]
eq(1, eval('b:lua_ftplugin'))
@@ -116,6 +120,7 @@ describe('runtime:', function()
write_file(indent_file , [[vim.b.lua_indent = 1]])
eq({'new-ft'}, funcs.getcompletion('new-f', 'filetype'))
+ eq({'indent/new-ft.lua'}, funcs.getcompletion('indent/new-f', 'runtime'))
exec [[set filetype=new-ft]]
eq(1, eval('b:lua_indent'))
@@ -152,6 +157,7 @@ describe('runtime:', function()
it('lua syntaxes are included in cmdline completion', function()
eq({'my-lang'}, funcs.getcompletion('my-l', 'filetype'))
eq({'my-lang'}, funcs.getcompletion('my-l', 'syntax'))
+ eq({'syntax/my-lang.lua'}, funcs.getcompletion('syntax/my-l', 'runtime'))
end)
end)