]> granicus.if.org Git - vim/commitdiff
patch 8.2.2037: compiler test depends on list of compiler plugins v8.2.2037
authorBram Moolenaar <Bram@vim.org>
Mon, 23 Nov 2020 20:24:58 +0000 (21:24 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 23 Nov 2020 20:24:58 +0000 (21:24 +0100)
Problem:    Compiler test depends on list of compiler plugins.
Solution:   Compare with the actual list of compiler plugins.

src/testdir/test_compiler.vim
src/version.c

index 6bf5f1521910b25d3405e54c15efe87c7dbec35a..ffafd5be2133d24096b112e4b5b392e3a1e6e0c2 100644 (file)
@@ -41,12 +41,18 @@ 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
 
 " Test executing :compiler from the command line, not from a script
@@ -59,8 +65,9 @@ func Test_compiler_commandline()
 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', @:)
index 3f79d3a856e75532bff9d4c5cf808a49fa574af7..95d4507187f9c473e060538c585cda80d0438347 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2037,
 /**/
     2036,
 /**/