Skip to content

Commit 60bc8e7

Browse files
committed
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.
1 parent 9e40c4b commit 60bc8e7

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

src/testdir/test_compiler.vim

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,18 @@ func Test_compiler()
4141
bw!
4242
endfunc
4343

44+
func GetCompilerNames()
45+
return glob('$VIMRUNTIME/compiler/*.vim', 0, 1)
46+
\ ->map({k, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')})
47+
endfunc
48+
4449
func Test_compiler_without_arg()
4550
let runtime = substitute($VIMRUNTIME, '\\', '/', 'g')
4651
let a = split(execute('compiler'))
47-
call assert_match(runtime .. '/compiler/ant.vim$', a[0])
48-
call assert_match(runtime .. '/compiler/bcc.vim$', a[1])
49-
call assert_match(runtime .. '/compiler/xo.vim$', a[-1])
52+
let exp = GetCompilerNames()
53+
call assert_match(runtime .. '/compiler/' .. exp[0] .. '.vim$', a[0])
54+
call assert_match(runtime .. '/compiler/' .. exp[1] .. '.vim$', a[1])
55+
call assert_match(runtime .. '/compiler/' .. exp[-1] .. '.vim$', a[-1])
5056
endfunc
5157

5258
" Test executing :compiler from the command line, not from a script
@@ -59,8 +65,9 @@ func Test_compiler_commandline()
5965
endfunc
6066

6167
func Test_compiler_completion()
68+
let clist = GetCompilerNames()->join(' ')
6269
call feedkeys(":compiler \<C-A>\<C-B>\"\<CR>", 'tx')
63-
call assert_match('^"compiler ant bcc .* xmlwf xo$', @:)
70+
call assert_match('^"compiler ' .. clist .. '$', @:)
6471

6572
call feedkeys(":compiler p\<C-A>\<C-B>\"\<CR>", 'tx')
6673
call assert_equal('"compiler pbx perl php pylint pyunit', @:)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2037,
753755
/**/
754756
2036,
755757
/**/

0 commit comments

Comments
 (0)