aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-11-01 23:24:49 +0000
committerSean Dewar <seandewar@users.noreply.github.com>2021-11-26 18:53:12 +0000
commit6e3e8c51c0919df4d407b323d0e9237c278e2c23 (patch)
treed65cd49747945a52cc10052eebad85a4d59c43f6 /src
parent752ca2cb9f61b4dc523552d4123729b9b26a3409 (diff)
downloadrneovim-6e3e8c51c0919df4d407b323d0e9237c278e2c23.tar.gz
rneovim-6e3e8c51c0919df4d407b323d0e9237c278e2c23.tar.bz2
rneovim-6e3e8c51c0919df4d407b323d0e9237c278e2c23.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_autocmd.vim3
-rw-r--r--src/nvim/testdir/test_compiler.vim10
-rw-r--r--src/nvim/testdir/test_fold.vim3
-rw-r--r--src/nvim/testdir/test_mksession.vim3
-rw-r--r--src/nvim/testdir/test_options.vim3
-rw-r--r--src/nvim/testdir/test_spell_utf8.vim6
-rw-r--r--src/nvim/testdir/test_startup.vim6
-rw-r--r--src/nvim/testdir/test_substitute.vim3
-rw-r--r--src/nvim/testdir/test_syntax.vim20
-rw-r--r--src/nvim/testdir/test_system.vim3
10 files changed, 21 insertions, 39 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 0c8b8a45d9..27b3eedfa1 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -526,8 +526,7 @@ func Test_autocmd_blast_badd()
call writefile(content, 'XblastBall')
call system(GetVimCommand() .. ' --clean -S XblastBall')
- " call assert_match('OK', readfile('Xerrors')->join())
- call assert_match('OK', join(readfile('Xerrors')))
+ call assert_match('OK', readfile('Xerrors')->join())
call delete('XblastBall')
call delete('Xerrors')
diff --git a/src/nvim/testdir/test_compiler.vim b/src/nvim/testdir/test_compiler.vim
index c3de7d0050..aaa2301bca 100644
--- a/src/nvim/testdir/test_compiler.vim
+++ b/src/nvim/testdir/test_compiler.vim
@@ -38,10 +38,9 @@ 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 sort(map(glob('$VIMRUNTIME/compiler/*.vim', 0, 1), {i, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')}))
+ return glob('$VIMRUNTIME/compiler/*.vim', 0, 1)
+ \ ->map({i, v -> substitute(v, '.*[\\/]\([a-zA-Z0-9_\-]*\).vim', '\1', '')})
+ \ ->sort()
endfunc
func Test_compiler_without_arg()
@@ -54,8 +53,7 @@ func Test_compiler_without_arg()
endfunc
func Test_compiler_completion()
- " let clist = GetCompilerNames()->join(' ')
- let clist = join(GetCompilerNames(), ' ')
+ let clist = GetCompilerNames()->join(' ')
call feedkeys(":compiler \<C-A>\<C-B>\"\<CR>", 'tx')
call assert_match('^"compiler ' .. clist .. '$', @:)
diff --git a/src/nvim/testdir/test_fold.vim b/src/nvim/testdir/test_fold.vim
index 5586fe2151..6da1b3d4a0 100644
--- a/src/nvim/testdir/test_fold.vim
+++ b/src/nvim/testdir/test_fold.vim
@@ -809,8 +809,7 @@ func Test_undo_fold_deletion()
g/"/d
undo
redo
- " eval getline(1, '$')->assert_equal([''])
- eval assert_equal(getline(1, '$'), [''])
+ eval getline(1, '$')->assert_equal([''])
set fdm&vim
bwipe!
diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim
index c96c6a9678..057895047d 100644
--- a/src/nvim/testdir/test_mksession.vim
+++ b/src/nvim/testdir/test_mksession.vim
@@ -156,8 +156,7 @@ func Test_mksession_zero_winheight()
wincmd _
mksession! Xtest_mks_zero
set winminheight&
- " let text = readfile('Xtest_mks_zero')->join()
- let text = join(readfile('Xtest_mks_zero'))
+ let text = readfile('Xtest_mks_zero')->join()
call delete('Xtest_mks_zero')
close
" check there is no divide by zero
diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim
index 41c689849b..7d9cada074 100644
--- a/src/nvim/testdir/test_options.vim
+++ b/src/nvim/testdir/test_options.vim
@@ -235,8 +235,7 @@ func Test_set_completion()
call feedkeys(":set filetype=sshdconfi\<Tab>\<C-B>\"\<CR>", 'xt')
call assert_equal('"set filetype=sshdconfig', @:)
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=' .. join(getcompletion('a*', 'filetype')), @:)
+ call assert_equal('"set filetype=' .. getcompletion('a*', 'filetype')->join(), @:)
endfunc
func Test_set_errors()
diff --git a/src/nvim/testdir/test_spell_utf8.vim b/src/nvim/testdir/test_spell_utf8.vim
index cafdb97f28..3d159f3352 100644
--- a/src/nvim/testdir/test_spell_utf8.vim
+++ b/src/nvim/testdir/test_spell_utf8.vim
@@ -512,8 +512,7 @@ func TestGoodBadBase()
break
endif
let prevbad = bad
- " let lst = bad->spellsuggest(3)
- let lst = spellsuggest(bad, 3)
+ let lst = bad->spellsuggest(3)
normal mm
call add(result, [bad, lst])
@@ -552,8 +551,7 @@ func Test_spell_basic()
\ )
call assert_equal("gebletegek", soundfold('goobledygoook'))
- " call assert_equal("kepereneven", 'kóopërÿnôven'->soundfold())
- call assert_equal("kepereneven", soundfold('kóopërÿnôven'))
+ call assert_equal("kepereneven", 'kóopërÿnôven'->soundfold())
call assert_equal("everles gesvets etele", soundfold('oeverloos gezwets edale'))
endfunc
diff --git a/src/nvim/testdir/test_startup.vim b/src/nvim/testdir/test_startup.vim
index b140077111..d830f5216d 100644
--- a/src/nvim/testdir/test_startup.vim
+++ b/src/nvim/testdir/test_startup.vim
@@ -905,15 +905,13 @@ func Test_not_a_term()
" This will take 2 seconds because of the missing --not-a-term
let cmd = GetVimProg() .. ' --cmd quit ' .. redir
exe "silent !" . cmd
- " call assert_match("\<Esc>", readfile('Xvimout')->join())
- call assert_match("\<Esc>", join(readfile('Xvimout')))
+ call assert_match("\<Esc>", readfile('Xvimout')->join())
call delete('Xvimout')
" With --not-a-term there are no escape sequences.
let cmd = GetVimProg() .. ' --not-a-term --cmd quit ' .. redir
exe "silent !" . cmd
- " call assert_notmatch("\<Esc>", readfile('Xvimout')->join())
- call assert_notmatch("\<Esc>", join(readfile('Xvimout')))
+ call assert_notmatch("\<Esc>", readfile('Xvimout')->join())
call delete('Xvimout')
endfunc
diff --git a/src/nvim/testdir/test_substitute.vim b/src/nvim/testdir/test_substitute.vim
index f06705a84c..113c85acef 100644
--- a/src/nvim/testdir/test_substitute.vim
+++ b/src/nvim/testdir/test_substitute.vim
@@ -752,8 +752,7 @@ endfunc
func Test_submatch_list_concatenate()
let pat = 'A\(.\)'
let Rep = {-> string([submatch(0, 1)] + [[submatch(1)]])}
- " call substitute('A1', pat, Rep, '')->assert_equal("[['A1'], ['1']]")
- call assert_equal(substitute('A1', pat, Rep, ''), "[['A1'], ['1']]")
+ call substitute('A1', pat, Rep, '')->assert_equal("[['A1'], ['1']]")
endfunc
func Test_substitute_skipped_range()
diff --git a/src/nvim/testdir/test_syntax.vim b/src/nvim/testdir/test_syntax.vim
index 914d9c2782..757866f5dc 100644
--- a/src/nvim/testdir/test_syntax.vim
+++ b/src/nvim/testdir/test_syntax.vim
@@ -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
" group and spaces represent no group, useful for visually describing tests.
let l:expectedGroups = type(a:expected) == v:t_string
- "\ ? a:expected->split('\zs')->map({_, v -> trim(v)})
- \ ? map(split(a:expected, '\zs'), {_, v -> trim(v)})
+ \ ? a:expected->split('\zs')->map({_, v -> trim(v)})
\ : a:expected
let l:errors = 0
- " let l:msg = (a:msg->empty() ? "" : a:msg .. ": ")
- let l:msg = (empty(a:msg) ? "" : a:msg .. ": ")
+ let l:msg = (a:msg->empty() ? "" : a:msg .. ": ")
\ .. "Wrong highlight group at " .. a:lnum .. ","
- " for l:i in range(a:startcol, a:startcol + l:expectedGroups->len() - 1)
- " let l:errors += synID(a:lnum, l:i, a:trans)
- " \ ->synIDattr("name")
- " \ ->assert_equal(l:expectedGroups[l:i - 1],
- for l:i in range(a:startcol, a:startcol + len(l:expectedGroups) - 1)
- let l:errors +=
- \ assert_equal(synIDattr(synID(a:lnum, l:i, a:trans), "name"),
- \ l:expectedGroups[l:i - 1],
- \ l:msg .. l:i)
+ for l:i in range(a:startcol, a:startcol + l:expectedGroups->len() - 1)
+ let l:errors += synID(a:lnum, l:i, a:trans)
+ \ ->synIDattr("name")
+ \ ->assert_equal(l:expectedGroups[l:i - 1],
+ \ l:msg .. l:i)
endfor
endfunc
diff --git a/src/nvim/testdir/test_system.vim b/src/nvim/testdir/test_system.vim
index 7b8ee778cc..1858b48807 100644
--- a/src/nvim/testdir/test_system.vim
+++ b/src/nvim/testdir/test_system.vim
@@ -121,8 +121,7 @@ func Test_system_with_shell_quote()
let msg = printf('shell=%s shellxquote=%s', &shell, &shellxquote)
try
- " let out = 'echo 123'->system()
- let out = system('echo 123')
+ let out = 'echo 123'->system()
catch
call assert_report(printf('%s: %s', msg, v:exception))
continue