mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 11:25:33 +00:00
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.
60bc8e7244
This commit is contained in:
@@ -37,17 +37,24 @@ func Test_compiler()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
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()
|
func Test_compiler_without_arg()
|
||||||
let runtime = substitute($VIMRUNTIME, '\\', '/', 'g')
|
let runtime = substitute($VIMRUNTIME, '\\', '/', 'g')
|
||||||
let a = split(execute('compiler'))
|
let a = split(execute('compiler'))
|
||||||
call assert_match(runtime .. '/compiler/ant.vim$', a[0])
|
let exp = GetCompilerNames()
|
||||||
call assert_match(runtime .. '/compiler/bcc.vim$', a[1])
|
call assert_match(runtime .. '/compiler/' .. exp[0] .. '.vim$', a[0])
|
||||||
call assert_match(runtime .. '/compiler/xo.vim$', a[-1])
|
call assert_match(runtime .. '/compiler/' .. exp[1] .. '.vim$', a[1])
|
||||||
|
call assert_match(runtime .. '/compiler/' .. exp[-1] .. '.vim$', a[-1])
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_compiler_completion()
|
func Test_compiler_completion()
|
||||||
|
let clist = GetCompilerNames()->join(' ')
|
||||||
call feedkeys(":compiler \<C-A>\<C-B>\"\<CR>", 'tx')
|
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 feedkeys(":compiler p\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
call assert_equal('"compiler pbx perl php pylint pyunit', @:)
|
call assert_equal('"compiler pbx perl php pylint pyunit', @:)
|
||||||
|
|||||||
Reference in New Issue
Block a user