From 8aae1521e5d8e6d6b16d58e218b57a72801beefe Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 30 Jan 2021 12:20:33 -0500 Subject: [PATCH 1/3] 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 --- src/nvim/testdir/test_compiler.vim | 15 +++++++++++---- 1 file 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 \\\"\", 'tx') - call assert_match('^"compiler ant bcc .* xmlwf xo$', @:) + call assert_match('^"compiler ' .. clist .. '$', @:) call feedkeys(":compiler p\\\"\", 'tx') call assert_equal('"compiler pbx perl php pylint pyunit', @:) From 647c9c558b2faad3cde4fe69501f1a2b72cc164a Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 30 Jan 2021 13:31:47 -0500 Subject: [PATCH 2/3] vim-patch:8.2.2038: compiler test fails on MS-Windows Problem: Compiler test fails on MS-Windows. Solution: Sort the found compiler plugin names. https://github.com/vim/vim/commit/142f23544c7045b22e56fa6ee35808aceb6342f2 --- src/nvim/testdir/test_compiler.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nvim/testdir/test_compiler.vim b/src/nvim/testdir/test_compiler.vim index 4d1107933a..0d135c3811 100644 --- a/src/nvim/testdir/test_compiler.vim +++ b/src/nvim/testdir/test_compiler.vim @@ -39,7 +39,8 @@ endfunc func GetCompilerNames() return glob('$VIMRUNTIME/compiler/*.vim', 0, 1) - \ ->map({k, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')}) + \ ->map({i, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')}) + \ ->sort() endfunc func Test_compiler_without_arg() From 150859d71779f507db01ac791452e9f0a3d5a60f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 30 Jan 2021 13:37:50 -0500 Subject: [PATCH 3/3] test/old: rewrite method code in test_compiler.vim Patch v8.1.1803 and related method patches are not ported yet. Revert this commit when those patches are ported. --- src/nvim/testdir/test_compiler.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/nvim/testdir/test_compiler.vim b/src/nvim/testdir/test_compiler.vim index 0d135c3811..d361205baa 100644 --- a/src/nvim/testdir/test_compiler.vim +++ b/src/nvim/testdir/test_compiler.vim @@ -38,9 +38,10 @@ func Test_compiler() endfunc func GetCompilerNames() - return glob('$VIMRUNTIME/compiler/*.vim', 0, 1) - \ ->map({i, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')}) - \ ->sort() + " return glob('$VIMRUNTIME/compiler/*.vim', 0, 1) + " \ ->map({i, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')}) + " \ ->sort() + return sort(map(glob('$VIMRUNTIME/compiler/*.vim', 0, 1), {i, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')})) endfunc func Test_compiler_without_arg() @@ -53,7 +54,8 @@ func Test_compiler_without_arg() endfunc func Test_compiler_completion() - let clist = GetCompilerNames()->join(' ') + " let clist = GetCompilerNames()->join(' ') + let clist = join(GetCompilerNames(), ' ') call feedkeys(":compiler \\\"\", 'tx') call assert_match('^"compiler ' .. clist .. '$', @:)