Merge pull request #13852 from janlazo/vim-8.2.2037

vim-patch:8.2.{2037,2038}
This commit is contained in:
Matthieu Coudron 2021-01-30 21:31:20 +01:00 committed by GitHub
commit c4d0211fea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,17 +37,27 @@ func Test_compiler()
bw!
endfunc
func GetCompilerNames()
" 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()
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(' ')
let clist = join(GetCompilerNames(), ' ')
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', @:)