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.
This commit is contained in:
Jan Edmund Lazo
2021-01-30 13:37:50 -05:00
parent 647c9c558b
commit 150859d717

View File

@@ -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 \<C-A>\<C-B>\"\<CR>", 'tx')
call assert_match('^"compiler ' .. clist .. '$', @:)