mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 22:36:09 +00:00
test(oldtest): uncomment method call syntax uses
We should now be equal with Vim in regards to method call support of already ported built-ins. Enable all relevant commented-out uses of the syntax in tests that I could grep.
This commit is contained in:
@@ -526,8 +526,7 @@ func Test_autocmd_blast_badd()
|
|||||||
|
|
||||||
call writefile(content, 'XblastBall')
|
call writefile(content, 'XblastBall')
|
||||||
call system(GetVimCommand() .. ' --clean -S XblastBall')
|
call system(GetVimCommand() .. ' --clean -S XblastBall')
|
||||||
" call assert_match('OK', readfile('Xerrors')->join())
|
call assert_match('OK', readfile('Xerrors')->join())
|
||||||
call assert_match('OK', join(readfile('Xerrors')))
|
|
||||||
|
|
||||||
call delete('XblastBall')
|
call delete('XblastBall')
|
||||||
call delete('Xerrors')
|
call delete('Xerrors')
|
||||||
|
@@ -38,10 +38,9 @@ func Test_compiler()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func GetCompilerNames()
|
func GetCompilerNames()
|
||||||
" return glob('$VIMRUNTIME/compiler/*.vim', 0, 1)
|
return glob('$VIMRUNTIME/compiler/*.vim', 0, 1)
|
||||||
" \ ->map({i, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')})
|
\ ->map({i, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')})
|
||||||
" \ ->sort()
|
\ ->sort()
|
||||||
return sort(map(glob('$VIMRUNTIME/compiler/*.vim', 0, 1), {i, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')}))
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_compiler_without_arg()
|
func Test_compiler_without_arg()
|
||||||
@@ -54,8 +53,7 @@ func Test_compiler_without_arg()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_compiler_completion()
|
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 feedkeys(":compiler \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
call assert_match('^"compiler ' .. clist .. '$', @:)
|
call assert_match('^"compiler ' .. clist .. '$', @:)
|
||||||
|
|
||||||
|
@@ -809,8 +809,7 @@ func Test_undo_fold_deletion()
|
|||||||
g/"/d
|
g/"/d
|
||||||
undo
|
undo
|
||||||
redo
|
redo
|
||||||
" eval getline(1, '$')->assert_equal([''])
|
eval getline(1, '$')->assert_equal([''])
|
||||||
eval assert_equal(getline(1, '$'), [''])
|
|
||||||
|
|
||||||
set fdm&vim
|
set fdm&vim
|
||||||
bwipe!
|
bwipe!
|
||||||
|
@@ -156,8 +156,7 @@ func Test_mksession_zero_winheight()
|
|||||||
wincmd _
|
wincmd _
|
||||||
mksession! Xtest_mks_zero
|
mksession! Xtest_mks_zero
|
||||||
set winminheight&
|
set winminheight&
|
||||||
" let text = readfile('Xtest_mks_zero')->join()
|
let text = readfile('Xtest_mks_zero')->join()
|
||||||
let text = join(readfile('Xtest_mks_zero'))
|
|
||||||
call delete('Xtest_mks_zero')
|
call delete('Xtest_mks_zero')
|
||||||
close
|
close
|
||||||
" check there is no divide by zero
|
" check there is no divide by zero
|
||||||
|
@@ -235,8 +235,7 @@ func Test_set_completion()
|
|||||||
call feedkeys(":set filetype=sshdconfi\<Tab>\<C-B>\"\<CR>", 'xt')
|
call feedkeys(":set filetype=sshdconfi\<Tab>\<C-B>\"\<CR>", 'xt')
|
||||||
call assert_equal('"set filetype=sshdconfig', @:)
|
call assert_equal('"set filetype=sshdconfig', @:)
|
||||||
call feedkeys(":set filetype=a\<C-A>\<C-B>\"\<CR>", 'xt')
|
call feedkeys(":set filetype=a\<C-A>\<C-B>\"\<CR>", 'xt')
|
||||||
" call assert_equal('"set filetype=' .. getcompletion('a*', 'filetype')->join(), @:)
|
call assert_equal('"set filetype=' .. getcompletion('a*', 'filetype')->join(), @:)
|
||||||
call assert_equal('"set filetype=' .. join(getcompletion('a*', 'filetype')), @:)
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_set_errors()
|
func Test_set_errors()
|
||||||
|
@@ -512,8 +512,7 @@ func TestGoodBadBase()
|
|||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
let prevbad = bad
|
let prevbad = bad
|
||||||
" let lst = bad->spellsuggest(3)
|
let lst = bad->spellsuggest(3)
|
||||||
let lst = spellsuggest(bad, 3)
|
|
||||||
normal mm
|
normal mm
|
||||||
|
|
||||||
call add(result, [bad, lst])
|
call add(result, [bad, lst])
|
||||||
@@ -552,8 +551,7 @@ func Test_spell_basic()
|
|||||||
\ )
|
\ )
|
||||||
|
|
||||||
call assert_equal("gebletegek", soundfold('goobledygoook'))
|
call assert_equal("gebletegek", soundfold('goobledygoook'))
|
||||||
" call assert_equal("kepereneven", 'kóopërÿnôven'->soundfold())
|
call assert_equal("kepereneven", 'kóopërÿnôven'->soundfold())
|
||||||
call assert_equal("kepereneven", soundfold('kóopërÿnôven'))
|
|
||||||
call assert_equal("everles gesvets etele", soundfold('oeverloos gezwets edale'))
|
call assert_equal("everles gesvets etele", soundfold('oeverloos gezwets edale'))
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -905,15 +905,13 @@ func Test_not_a_term()
|
|||||||
" This will take 2 seconds because of the missing --not-a-term
|
" This will take 2 seconds because of the missing --not-a-term
|
||||||
let cmd = GetVimProg() .. ' --cmd quit ' .. redir
|
let cmd = GetVimProg() .. ' --cmd quit ' .. redir
|
||||||
exe "silent !" . cmd
|
exe "silent !" . cmd
|
||||||
" call assert_match("\<Esc>", readfile('Xvimout')->join())
|
call assert_match("\<Esc>", readfile('Xvimout')->join())
|
||||||
call assert_match("\<Esc>", join(readfile('Xvimout')))
|
|
||||||
call delete('Xvimout')
|
call delete('Xvimout')
|
||||||
|
|
||||||
" With --not-a-term there are no escape sequences.
|
" With --not-a-term there are no escape sequences.
|
||||||
let cmd = GetVimProg() .. ' --not-a-term --cmd quit ' .. redir
|
let cmd = GetVimProg() .. ' --not-a-term --cmd quit ' .. redir
|
||||||
exe "silent !" . cmd
|
exe "silent !" . cmd
|
||||||
" call assert_notmatch("\<Esc>", readfile('Xvimout')->join())
|
call assert_notmatch("\<Esc>", readfile('Xvimout')->join())
|
||||||
call assert_notmatch("\<Esc>", join(readfile('Xvimout')))
|
|
||||||
call delete('Xvimout')
|
call delete('Xvimout')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -752,8 +752,7 @@ endfunc
|
|||||||
func Test_submatch_list_concatenate()
|
func Test_submatch_list_concatenate()
|
||||||
let pat = 'A\(.\)'
|
let pat = 'A\(.\)'
|
||||||
let Rep = {-> string([submatch(0, 1)] + [[submatch(1)]])}
|
let Rep = {-> string([submatch(0, 1)] + [[submatch(1)]])}
|
||||||
" call substitute('A1', pat, Rep, '')->assert_equal("[['A1'], ['1']]")
|
call substitute('A1', pat, Rep, '')->assert_equal("[['A1'], ['1']]")
|
||||||
call assert_equal(substitute('A1', pat, Rep, ''), "[['A1'], ['1']]")
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_substitute_skipped_range()
|
func Test_substitute_skipped_range()
|
||||||
|
@@ -30,23 +30,17 @@ func AssertHighlightGroups(lnum, startcol, expected, trans = 1, msg = "")
|
|||||||
" If groups are provided as a string, each character is assumed to be a
|
" If groups are provided as a string, each character is assumed to be a
|
||||||
" group and spaces represent no group, useful for visually describing tests.
|
" group and spaces represent no group, useful for visually describing tests.
|
||||||
let l:expectedGroups = type(a:expected) == v:t_string
|
let l:expectedGroups = type(a:expected) == v:t_string
|
||||||
"\ ? a:expected->split('\zs')->map({_, v -> trim(v)})
|
\ ? a:expected->split('\zs')->map({_, v -> trim(v)})
|
||||||
\ ? map(split(a:expected, '\zs'), {_, v -> trim(v)})
|
|
||||||
\ : a:expected
|
\ : a:expected
|
||||||
let l:errors = 0
|
let l:errors = 0
|
||||||
" let l:msg = (a:msg->empty() ? "" : a:msg .. ": ")
|
let l:msg = (a:msg->empty() ? "" : a:msg .. ": ")
|
||||||
let l:msg = (empty(a:msg) ? "" : a:msg .. ": ")
|
|
||||||
\ .. "Wrong highlight group at " .. a:lnum .. ","
|
\ .. "Wrong highlight group at " .. a:lnum .. ","
|
||||||
|
|
||||||
" for l:i in range(a:startcol, a:startcol + l:expectedGroups->len() - 1)
|
for l:i in range(a:startcol, a:startcol + l:expectedGroups->len() - 1)
|
||||||
" let l:errors += synID(a:lnum, l:i, a:trans)
|
let l:errors += synID(a:lnum, l:i, a:trans)
|
||||||
" \ ->synIDattr("name")
|
\ ->synIDattr("name")
|
||||||
" \ ->assert_equal(l:expectedGroups[l:i - 1],
|
\ ->assert_equal(l:expectedGroups[l:i - 1],
|
||||||
for l:i in range(a:startcol, a:startcol + len(l:expectedGroups) - 1)
|
\ l:msg .. l:i)
|
||||||
let l:errors +=
|
|
||||||
\ assert_equal(synIDattr(synID(a:lnum, l:i, a:trans), "name"),
|
|
||||||
\ l:expectedGroups[l:i - 1],
|
|
||||||
\ l:msg .. l:i)
|
|
||||||
endfor
|
endfor
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -121,8 +121,7 @@ func Test_system_with_shell_quote()
|
|||||||
let msg = printf('shell=%s shellxquote=%s', &shell, &shellxquote)
|
let msg = printf('shell=%s shellxquote=%s', &shell, &shellxquote)
|
||||||
|
|
||||||
try
|
try
|
||||||
" let out = 'echo 123'->system()
|
let out = 'echo 123'->system()
|
||||||
let out = system('echo 123')
|
|
||||||
catch
|
catch
|
||||||
call assert_report(printf('%s: %s', msg, v:exception))
|
call assert_report(printf('%s: %s', msg, v:exception))
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user