aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/runtime_spec.lua
diff options
context:
space:
mode:
authorshadmansaleh <shadmansaleh3@gmail.com>2021-06-02 21:08:28 +0600
committershadmansaleh <shadmansaleh3@gmail.com>2021-06-11 01:01:03 +0600
commitf000251e087637d1add3678184ada80bef432fa9 (patch)
treef583676eb7298690e35cc4f1ff3bdcb4c1b3ad53 /test/functional/lua/runtime_spec.lua
parentf256a18fefeebe76edcca42f530b238e95bc25b6 (diff)
downloadrneovim-f000251e087637d1add3678184ada80bef432fa9.tar.gz
rneovim-f000251e087637d1add3678184ada80bef432fa9.tar.bz2
rneovim-f000251e087637d1add3678184ada80bef432fa9.zip
feat(runtime): Allow lua to be used in syntax
Diffstat (limited to 'test/functional/lua/runtime_spec.lua')
-rw-r--r--test/functional/lua/runtime_spec.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/functional/lua/runtime_spec.lua b/test/functional/lua/runtime_spec.lua
index 7286e89c76..cbdc6fa184 100644
--- a/test/functional/lua/runtime_spec.lua
+++ b/test/functional/lua/runtime_spec.lua
@@ -172,5 +172,35 @@ describe('runtime:', function()
end)
end)
+ describe('syntax', function()
+ local syntax_folder = table.concat({xconfig, 'nvim', 'syntax'}, pathsep)
+
+ before_each(clear)
+
+ it('loads lua syntaxes on filetype change', function()
+ local syntax_file = table.concat({syntax_folder , 'my-lang.lua'}, pathsep)
+ mkdir_p(syntax_folder)
+ write_file(syntax_file , [[vim.g.lua_syntax = 1]])
+
+ clear{ args_rm={'-u' }, env={ XDG_CONFIG_HOME=xconfig, VIMRUNTIME='runtime/' }}
+
+ exec('set filetype=my-lang')
+ eq(1, eval('g:lua_syntax'))
+ rmdir(syntax_folder)
+ end)
+
+ it('loads lua syntaxes on syntax change', function()
+ local syntax_file = table.concat({syntax_folder , 'my-lang.lua'}, pathsep)
+ mkdir_p(syntax_folder)
+ write_file(syntax_file , [[vim.g.lua_syntax = 5]])
+
+ clear{ args_rm={'-u' }, env={ XDG_CONFIG_HOME=xconfig, VIMRUNTIME='runtime/' }}
+
+ exec('set syntax=my-lang')
+ eq(5, eval('g:lua_syntax'))
+ rmdir(syntax_folder)
+ end)
+ end)
+
end)