diff options
author | shadmansaleh <shadmansaleh3@gmail.com> | 2021-06-02 13:48:13 +0600 |
---|---|---|
committer | shadmansaleh <shadmansaleh3@gmail.com> | 2021-06-11 01:01:02 +0600 |
commit | 68be8b99cfb1ab6105c48707986ce409ca38dd35 (patch) | |
tree | e0d3a12f6531b4766f431535949f627132ecb83d /test/functional/lua/runtime_spec.lua | |
parent | 1e6c02510afd79659519f2a69075b36784134322 (diff) | |
download | rneovim-68be8b99cfb1ab6105c48707986ce409ca38dd35.tar.gz rneovim-68be8b99cfb1ab6105c48707986ce409ca38dd35.tar.bz2 rneovim-68be8b99cfb1ab6105c48707986ce409ca38dd35.zip |
feat(runtime): Allow lua to be used in compiler
Diffstat (limited to 'test/functional/lua/runtime_spec.lua')
-rw-r--r-- | test/functional/lua/runtime_spec.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/functional/lua/runtime_spec.lua b/test/functional/lua/runtime_spec.lua index a37570e4a4..11407ad19c 100644 --- a/test/functional/lua/runtime_spec.lua +++ b/test/functional/lua/runtime_spec.lua @@ -85,5 +85,35 @@ describe('runtime:', function() end) end) + describe('compiler', function() + local compiler_folder = table.concat({xconfig, 'nvim', 'compiler'}, pathsep) + + it('loads lua compilers', function() + local compiler_file = table.concat({compiler_folder, 'new_compiler.lua'}, + pathsep) + mkdir_p(compiler_folder) + write_file(compiler_file, [[vim.g.lua_compiler = 1]]) + + clear{ args_rm={'-' }, env={ XDG_CONFIG_HOME=xconfig }} + exec('compiler new_compiler') + + eq(1, eval('g:lua_compiler')) + rmdir(compiler_folder) + end) + + it('loads vim compilers when both lua and vim version exist', function() + local compiler_file = table.concat({compiler_folder, 'new_compiler'}, + pathsep) + mkdir_p(compiler_folder) + write_file(compiler_file..'.vim', [[let g:compiler = 'vim']]) + write_file(compiler_file..'.lua', [[vim.g.compiler = 'lua']]) + + clear{ args_rm={'-u' }, env={ XDG_CONFIG_HOME=xconfig }} + exec('compiler new_compiler') + + eq('vim', eval('g:compiler')) + rmdir(compiler_folder) + end) + end) end) |