diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-01-30 12:20:33 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-01-30 13:37:25 -0500 |
commit | 8aae1521e5d8e6d6b16d58e218b57a72801beefe (patch) | |
tree | 9ea3d2b08f770cc7e6e9146c3b3cf53ad2882ffe /src | |
parent | ad98b84008586a1863e8b05b3db6d2c6c7ad4db8 (diff) | |
download | rneovim-8aae1521e5d8e6d6b16d58e218b57a72801beefe.tar.gz rneovim-8aae1521e5d8e6d6b16d58e218b57a72801beefe.tar.bz2 rneovim-8aae1521e5d8e6d6b16d58e218b57a72801beefe.zip |
vim-patch:8.2.2037: compiler test depends on list of compiler plugins
Problem: Compiler test depends on list of compiler plugins.
Solution: Compare with the actual list of compiler plugins.
https://github.com/vim/vim/commit/60bc8e7244080b7ead009cfabebc3401f272ddbe
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_compiler.vim | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/nvim/testdir/test_compiler.vim b/src/nvim/testdir/test_compiler.vim index 9101f8cfa0..4d1107933a 100644 --- a/src/nvim/testdir/test_compiler.vim +++ b/src/nvim/testdir/test_compiler.vim @@ -37,17 +37,24 @@ func Test_compiler() bw! endfunc +func GetCompilerNames() + return glob('$VIMRUNTIME/compiler/*.vim', 0, 1) + \ ->map({k, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')}) +endfunc + func Test_compiler_without_arg() let runtime = substitute($VIMRUNTIME, '\\', '/', 'g') let a = split(execute('compiler')) - call assert_match(runtime .. '/compiler/ant.vim$', a[0]) - call assert_match(runtime .. '/compiler/bcc.vim$', a[1]) - call assert_match(runtime .. '/compiler/xo.vim$', a[-1]) + let exp = GetCompilerNames() + call assert_match(runtime .. '/compiler/' .. exp[0] .. '.vim$', a[0]) + call assert_match(runtime .. '/compiler/' .. exp[1] .. '.vim$', a[1]) + call assert_match(runtime .. '/compiler/' .. exp[-1] .. '.vim$', a[-1]) endfunc func Test_compiler_completion() + let clist = GetCompilerNames()->join(' ') call feedkeys(":compiler \<C-A>\<C-B>\"\<CR>", 'tx') - call assert_match('^"compiler ant bcc .* xmlwf xo$', @:) + call assert_match('^"compiler ' .. clist .. '$', @:) call feedkeys(":compiler p\<C-A>\<C-B>\"\<CR>", 'tx') call assert_equal('"compiler pbx perl php pylint pyunit', @:) |