aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/runtime_spec.lua
diff options
context:
space:
mode:
authorshadmansaleh <shadmansaleh3@gmail.com>2021-06-02 16:25:50 +0600
committershadmansaleh <shadmansaleh3@gmail.com>2021-06-11 01:01:02 +0600
commitfd5e5d2715d264447d94d7253f3c78bd7003a472 (patch)
treecd4cd78d99197de5e30d18c7a078d70ebc4575c1 /test/functional/lua/runtime_spec.lua
parent68be8b99cfb1ab6105c48707986ce409ca38dd35 (diff)
downloadrneovim-fd5e5d2715d264447d94d7253f3c78bd7003a472.tar.gz
rneovim-fd5e5d2715d264447d94d7253f3c78bd7003a472.tar.bz2
rneovim-fd5e5d2715d264447d94d7253f3c78bd7003a472.zip
feat(runtime): Allow lua to be used in ftplugin
Diffstat (limited to 'test/functional/lua/runtime_spec.lua')
-rw-r--r--test/functional/lua/runtime_spec.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/lua/runtime_spec.lua b/test/functional/lua/runtime_spec.lua
index 11407ad19c..b55141f427 100644
--- a/test/functional/lua/runtime_spec.lua
+++ b/test/functional/lua/runtime_spec.lua
@@ -23,6 +23,7 @@ describe('runtime:', function()
end)
describe('plugin', function()
+ before_each(clear)
it('loads plugin/*.lua from XDG config home', function()
local plugin_folder_path = table.concat({xconfig, 'nvim', 'plugin'}, pathsep)
local plugin_file_path = table.concat({plugin_folder_path, 'plugin.lua'}, pathsep)
@@ -53,6 +54,7 @@ describe('runtime:', function()
end)
describe('colors', function()
+ before_each(clear)
it('loads lua colorscheme', function()
local colorscheme_folder = table.concat({xconfig, 'nvim', 'colors'},
pathsep)
@@ -87,6 +89,7 @@ describe('runtime:', function()
describe('compiler', function()
local compiler_folder = table.concat({xconfig, 'nvim', 'compiler'}, pathsep)
+ before_each(clear)
it('loads lua compilers', function()
local compiler_file = table.concat({compiler_folder, 'new_compiler.lua'},
@@ -115,5 +118,23 @@ describe('runtime:', function()
rmdir(compiler_folder)
end)
end)
+
+ describe('ftplugin', function()
+ local ftplugin_folder = table.concat({xconfig, 'nvim', 'ftplugin'}, pathsep)
+
+ before_each(clear)
+
+ it('loads lua ftplugins', function()
+ local ftplugin_file = table.concat({ftplugin_folder , 'new-ft.lua'}, pathsep)
+ mkdir_p(ftplugin_folder)
+ write_file(ftplugin_file , [[ vim.g.lua_ftplugin = 1 ]])
+
+ clear{ args_rm={'-u' }, env={ XDG_CONFIG_HOME=xconfig, VIMRUNTIME='runtime/' }}
+
+ exec [[set filetype=new-ft]]
+ eq(1, eval('g:lua_ftplugin'))
+ rmdir(ftplugin_folder)
+ end)
+ end)
end)