aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-12-07 01:14:21 -0500
committerGitHub <noreply@github.com>2021-12-07 01:14:21 -0500
commitafaad8b54ebd2ad4ba2145f4069f5017cace3c8f (patch)
tree462cb857957f22fa3f8111d766c27907aebb19b4 /src/nvim/testdir
parentbf9e8a9df90941320ed898ac4c6351b78366a0a8 (diff)
parent6e3e8c51c0919df4d407b323d0e9237c278e2c23 (diff)
downloadrneovim-afaad8b54ebd2ad4ba2145f4069f5017cace3c8f.tar.gz
rneovim-afaad8b54ebd2ad4ba2145f4069f5017cace3c8f.tar.bz2
rneovim-afaad8b54ebd2ad4ba2145f4069f5017cace3c8f.zip
Merge pull request #16194 from seandewar/vim-8.1.1925
vim-patch:7.4.1777,8.1.{1925,1995,2011,2012,2013,2166},8.2.{0532,0871,1168,1241,3576}
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_autocmd.vim3
-rw-r--r--src/nvim/testdir/test_breakindent.vim2
-rw-r--r--src/nvim/testdir/test_bufwintabinfo.vim5
-rw-r--r--src/nvim/testdir/test_cd.vim2
-rw-r--r--src/nvim/testdir/test_charsearch.vim2
-rw-r--r--src/nvim/testdir/test_clientserver.vim2
-rw-r--r--src/nvim/testdir/test_cmdline.vim2
-rw-r--r--src/nvim/testdir/test_compiler.vim10
-rw-r--r--src/nvim/testdir/test_cursor_func.vim6
-rw-r--r--src/nvim/testdir/test_diffmode.vim2
-rw-r--r--src/nvim/testdir/test_environ.vim2
-rw-r--r--src/nvim/testdir/test_execute_func.vim2
-rw-r--r--src/nvim/testdir/test_expr.vim6
-rw-r--r--src/nvim/testdir/test_fold.vim3
-rw-r--r--src/nvim/testdir/test_functions.vim37
-rw-r--r--src/nvim/testdir/test_listchars.vim2
-rw-r--r--src/nvim/testdir/test_marks.vim4
-rw-r--r--src/nvim/testdir/test_matchadd_conceal_utf8.vim2
-rw-r--r--src/nvim/testdir/test_messages.vim2
-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_prompt_buffer.vim4
-rw-r--r--src/nvim/testdir/test_put.vim2
-rw-r--r--src/nvim/testdir/test_quickfix.vim4
-rw-r--r--src/nvim/testdir/test_ruby.vim2
-rw-r--r--src/nvim/testdir/test_search.vim37
-rw-r--r--src/nvim/testdir/test_sha256.vim10
-rw-r--r--src/nvim/testdir/test_signs.vim19
-rw-r--r--src/nvim/testdir/test_spell.vim6
-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.vim5
-rw-r--r--src/nvim/testdir/test_swap.vim4
-rw-r--r--src/nvim/testdir/test_syntax.vim20
-rw-r--r--src/nvim/testdir/test_system.vim3
-rw-r--r--src/nvim/testdir/test_tabpage.vim4
-rw-r--r--src/nvim/testdir/test_tagjump.vim2
-rw-r--r--src/nvim/testdir/test_taglist.vim2
-rw-r--r--src/nvim/testdir/test_timers.vim10
-rw-r--r--src/nvim/testdir/test_undo.vim2
-rw-r--r--src/nvim/testdir/test_utf8.vim4
-rw-r--r--src/nvim/testdir/test_vartabs.vim2
-rw-r--r--src/nvim/testdir/test_window_cmd.vim29
-rw-r--r--src/nvim/testdir/test_window_id.vim17
44 files changed, 176 insertions, 126 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 5b145dd1d2..4e1a24af61 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_breakindent.vim b/src/nvim/testdir/test_breakindent.vim
index 277050876e..8d592f21ea 100644
--- a/src/nvim/testdir/test_breakindent.vim
+++ b/src/nvim/testdir/test_breakindent.vim
@@ -432,7 +432,7 @@ func Test_breakindent11_vartabs()
call s:test_windows('setl cpo-=n sbr=>> nu nuw=4 nolist briopt= ts=4 vts=4')
let text = getline(2)
let width = strlen(text[1:]) + 2->indent() + strlen(&sbr) * 3 " text wraps 3 times
- call assert_equal(width, strdisplaywidth(text))
+ call assert_equal(width, text->strdisplaywidth())
call s:close_windows('set sbr= vts&')
endfunc
diff --git a/src/nvim/testdir/test_bufwintabinfo.vim b/src/nvim/testdir/test_bufwintabinfo.vim
index c04c8fbf60..a6eb93b4be 100644
--- a/src/nvim/testdir/test_bufwintabinfo.vim
+++ b/src/nvim/testdir/test_bufwintabinfo.vim
@@ -20,6 +20,9 @@ function Test_getbufwintabinfo()
call assert_equal('vim', l[0].variables.editor)
call assert_notequal(-1, index(l[0].windows, '%'->bufwinid()))
+ let l = '%'->getbufinfo()
+ call assert_equal(bufnr('%'), l[0].bufnr)
+
" Test for getbufinfo() with 'bufmodified'
call assert_equal(0, len(getbufinfo({'bufmodified' : 1})))
call setbufline('Xtestfile1', 1, ["Line1"])
@@ -48,7 +51,7 @@ function Test_getbufwintabinfo()
tabnew | let w3_id = win_getid()
new | let w4_id = win_getid()
vert new | let w5_id = win_getid()
- call setwinvar(0, 'signal', 'green')
+ eval 'green'->setwinvar(0, 'signal')
tabfirst
let winlist = getwininfo()
call assert_equal(5, len(winlist))
diff --git a/src/nvim/testdir/test_cd.vim b/src/nvim/testdir/test_cd.vim
index 57db0a2544..76a2620be0 100644
--- a/src/nvim/testdir/test_cd.vim
+++ b/src/nvim/testdir/test_cd.vim
@@ -101,7 +101,7 @@ func Test_chdir_func()
call assert_match('^\[global\] .*/Xdir$', trim(execute('verbose pwd')))
call chdir('..')
call assert_equal('y', fnamemodify(getcwd(1, 2), ':t'))
- call assert_equal('z', fnamemodify(getcwd(3, 2), ':t'))
+ call assert_equal('z', fnamemodify(3->getcwd(2), ':t'))
tabnext | wincmd t
call assert_match('^\[tabpage\] .*/y$', trim(execute('verbose pwd')))
call chdir('..')
diff --git a/src/nvim/testdir/test_charsearch.vim b/src/nvim/testdir/test_charsearch.vim
index 17a49e02be..6f09e85a42 100644
--- a/src/nvim/testdir/test_charsearch.vim
+++ b/src/nvim/testdir/test_charsearch.vim
@@ -20,7 +20,7 @@ func Test_charsearch()
" check that setcharsearch() changes the settings.
3
normal! ylfep
- call setcharsearch({'char': 'k'})
+ eval {'char': 'k'}->setcharsearch()
normal! ;p
call setcharsearch({'forward': 0})
normal! $;p
diff --git a/src/nvim/testdir/test_clientserver.vim b/src/nvim/testdir/test_clientserver.vim
index f3db472b03..922803438f 100644
--- a/src/nvim/testdir/test_clientserver.vim
+++ b/src/nvim/testdir/test_clientserver.vim
@@ -82,7 +82,7 @@ func Test_client_server()
call remote_send(name, ":call server2client(expand('<client>'), 'got it')\<CR>", 'g:myserverid')
call assert_equal('got it', g:myserverid->remote_read(2))
- call remote_send(name, ":call server2client(expand('<client>'), 'another')\<CR>", 'g:myserverid')
+ call remote_send(name, ":eval expand('<client>')->server2client('another')\<CR>", 'g:myserverid')
let peek_result = 'nothing'
let r = g:myserverid->remote_peek('peek_result')
" unpredictable whether the result is already available.
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index 75e17b47b8..49a5386337 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -905,7 +905,7 @@ func Test_setcmdpos()
call assert_equal('"12ab', @:)
" setcmdpos() returns 1 when not editing the command line.
- call assert_equal(1, setcmdpos(3))
+ call assert_equal(1, 3->setcmdpos())
endfunc
func Test_cmdline_overstrike()
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_cursor_func.vim b/src/nvim/testdir/test_cursor_func.vim
index 46847e0663..e8c4a952ee 100644
--- a/src/nvim/testdir/test_cursor_func.vim
+++ b/src/nvim/testdir/test_cursor_func.vim
@@ -37,7 +37,7 @@ endfunc
" Very short version of what matchparen does.
function s:Highlight_Matching_Pair()
let save_cursor = getcurpos()
- call setpos('.', save_cursor)
+ eval save_cursor->setpos('.')
endfunc
func Test_curswant_with_autocommand()
@@ -82,11 +82,11 @@ func Test_screenpos()
call assert_equal({'row': winrow,
\ 'col': wincol + 0,
\ 'curscol': wincol + 7,
- \ 'endcol': wincol + 7}, screenpos(winid, 1, 1))
+ \ 'endcol': wincol + 7}, winid->screenpos(1, 1))
call assert_equal({'row': winrow,
\ 'col': wincol + 13,
\ 'curscol': wincol + 13,
- \ 'endcol': wincol + 13}, screenpos(winid, 1, 7))
+ \ 'endcol': wincol + 13}, winid->screenpos(1, 7))
call assert_equal({'row': winrow + 2,
\ 'col': wincol + 1,
\ 'curscol': wincol + 1,
diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim
index 61da3cbcaa..3a0c615cf6 100644
--- a/src/nvim/testdir/test_diffmode.vim
+++ b/src/nvim/testdir/test_diffmode.vim
@@ -387,7 +387,7 @@ func Test_diffoff()
call setline(1, ['One', '', 'Two', 'Three'])
diffthis
redraw
- call assert_notequal(normattr, screenattr(1, 1))
+ call assert_notequal(normattr, 1->screenattr(1))
diffoff!
redraw
call assert_equal(normattr, screenattr(1, 1))
diff --git a/src/nvim/testdir/test_environ.vim b/src/nvim/testdir/test_environ.vim
index cc15b63824..dd34983ee5 100644
--- a/src/nvim/testdir/test_environ.vim
+++ b/src/nvim/testdir/test_environ.vim
@@ -22,7 +22,7 @@ endfunc
func Test_setenv()
unlet! $TESTENV
- call setenv('TEST ENV', 'foo')
+ eval 'foo'->setenv('TEST ENV')
call assert_equal('foo', getenv('TEST ENV'))
call setenv('TEST ENV', v:null)
call assert_equal(v:null, getenv('TEST ENV'))
diff --git a/src/nvim/testdir/test_execute_func.vim b/src/nvim/testdir/test_execute_func.vim
index f2c7da0aa9..2cb6d73407 100644
--- a/src/nvim/testdir/test_execute_func.vim
+++ b/src/nvim/testdir/test_execute_func.vim
@@ -99,7 +99,7 @@ func Test_win_execute()
if has('textprop')
let popupwin = popup_create('the popup win', {'line': 2, 'col': 3})
redraw
- let line = win_execute(popupwin, 'echo getline(1)')
+ let line = 'echo getline(1)'->win_execute(popupwin)
call assert_match('the popup win', line)
call popup_close(popupwin)
diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim
index 6343c47fde..1d7fd3e385 100644
--- a/src/nvim/testdir/test_expr.vim
+++ b/src/nvim/testdir/test_expr.vim
@@ -56,7 +56,7 @@ endfunc
func Test_strgetchar()
call assert_equal(char2nr('a'), strgetchar('axb', 0))
- call assert_equal(char2nr('x'), strgetchar('axb', 1))
+ call assert_equal(char2nr('x'), 'axb'->strgetchar(1))
call assert_equal(char2nr('b'), strgetchar('axb', 2))
call assert_equal(-1, strgetchar('axb', -1))
@@ -66,7 +66,7 @@ endfunc
func Test_strcharpart()
call assert_equal('a', strcharpart('axb', 0, 1))
- call assert_equal('x', strcharpart('axb', 1, 1))
+ call assert_equal('x', 'axb'->strcharpart(1, 1))
call assert_equal('b', strcharpart('axb', 2, 1))
call assert_equal('xb', strcharpart('axb', 1))
@@ -493,7 +493,7 @@ func Test_setmatches()
let set[0]['conceal'] = 5
let exp[0]['conceal'] = '5'
endif
- call setmatches(set)
+ eval set->setmatches()
call assert_equal(exp, getmatches())
endfunc
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_functions.vim b/src/nvim/testdir/test_functions.vim
index 4a2ade5afa..0edbeb420a 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -143,7 +143,7 @@ func Test_str2nr()
call assert_equal(-123456789, str2nr('-123456789'))
call assert_equal(5, str2nr('101', 2))
- call assert_equal(5, str2nr('0b101', 2))
+ call assert_equal(5, '0b101'->str2nr(2))
call assert_equal(5, str2nr('0B101', 2))
call assert_equal(-5, str2nr('-101', 2))
call assert_equal(-5, str2nr('-0b101', 2))
@@ -200,7 +200,7 @@ func Test_strftime()
" of strftime() can be 17 or 18, depending on timezone.
call assert_match('^2017-01-1[78]$', strftime('%Y-%m-%d', 1484695512))
"
- call assert_match('^\d\d\d\d-\(0\d\|1[012]\)-\([012]\d\|3[01]\) \([01]\d\|2[0-3]\):[0-5]\d:\([0-5]\d\|60\)$', strftime('%Y-%m-%d %H:%M:%S'))
+ call assert_match('^\d\d\d\d-\(0\d\|1[012]\)-\([012]\d\|3[01]\) \([01]\d\|2[0-3]\):[0-5]\d:\([0-5]\d\|60\)$', '%Y-%m-%d %H:%M:%S'->strftime())
call assert_fails('call strftime([])', 'E730:')
call assert_fails('call strftime("%Y", [])', 'E745:')
@@ -307,13 +307,19 @@ func Test_resolve_unix()
call assert_equal('/', resolve('/'))
endfunc
+func s:normalize_fname(fname)
+ let ret = substitute(a:fname, '\', '/', 'g')
+ let ret = substitute(ret, '//', '/', 'g')
+ return ret->tolower()
+endfunc
+
func Test_simplify()
call assert_equal('', simplify(''))
call assert_equal('/', simplify('/'))
call assert_equal('/', simplify('/.'))
call assert_equal('/', simplify('/..'))
call assert_equal('/...', simplify('/...'))
- call assert_equal('./dir/file', simplify('./dir/file'))
+ call assert_equal('./dir/file', './dir/file'->simplify())
call assert_equal('./dir/file', simplify('.///dir//file'))
call assert_equal('./dir/file', simplify('./dir/./file'))
call assert_equal('./file', simplify('./dir/../file'))
@@ -346,7 +352,7 @@ func Test_setbufvar_options()
wincmd h
let wh = winheight(0)
let dummy_buf = bufnr('dummy_buf2', v:true)
- call setbufvar(dummy_buf, '&buftype', 'nofile')
+ eval 'nofile'->setbufvar(dummy_buf, '&buftype')
execute 'belowright vertical split #' . dummy_buf
call assert_equal(wh, winheight(0))
@@ -375,7 +381,7 @@ endfunc
func Test_strpart()
call assert_equal('de', strpart('abcdefg', 3, 2))
call assert_equal('ab', strpart('abcdefg', -2, 4))
- call assert_equal('abcdefg', strpart('abcdefg', -2))
+ call assert_equal('abcdefg', 'abcdefg'->strpart(-2))
call assert_equal('fg', strpart('abcdefg', 5, 4))
call assert_equal('defg', strpart('abcdefg', 3))
@@ -469,7 +475,7 @@ func Test_toupper()
\ toupper(' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'))
" Test with a few lowercase diacritics.
- call assert_equal("AÀÁÂÃÄÅĀĂĄǍǞǠẢ", toupper("aàáâãäåāăąǎǟǡả"))
+ call assert_equal("AÀÁÂÃÄÅĀĂĄǍǞǠẢ", "aàáâãäåāăąǎǟǡả"->toupper())
call assert_equal("BḂḆ", toupper("bḃḇ"))
call assert_equal("CÇĆĈĊČ", toupper("cçćĉċč"))
call assert_equal("DĎĐḊḎḐ", toupper("dďđḋḏḑ"))
@@ -532,6 +538,11 @@ func Test_toupper()
call toupper("123\xC0\x80\xC0")
endfunc
+func Test_tr()
+ call assert_equal('foo', tr('bar', 'bar', 'foo'))
+ call assert_equal('zxy', 'cab'->tr('abc', 'xyz'))
+endfunc
+
" Tests for the mode() function
let current_modes = ''
func Save_mode()
@@ -809,11 +820,11 @@ endfunc
func Test_stridx()
call assert_equal(-1, stridx('', 'l'))
call assert_equal(0, stridx('', ''))
- call assert_equal(0, stridx('hello', ''))
+ call assert_equal(0, 'hello'->stridx(''))
call assert_equal(-1, stridx('hello', 'L'))
call assert_equal(2, stridx('hello', 'l', -1))
call assert_equal(2, stridx('hello', 'l', 0))
- call assert_equal(2, stridx('hello', 'l', 1))
+ call assert_equal(2, 'hello'->stridx('l', 1))
call assert_equal(3, stridx('hello', 'l', 3))
call assert_equal(-1, stridx('hello', 'l', 4))
call assert_equal(-1, stridx('hello', 'l', 10))
@@ -826,7 +837,7 @@ func Test_strridx()
call assert_equal(0, strridx('', ''))
call assert_equal(5, strridx('hello', ''))
call assert_equal(-1, strridx('hello', 'L'))
- call assert_equal(3, strridx('hello', 'l'))
+ call assert_equal(3, 'hello'->strridx('l'))
call assert_equal(3, strridx('hello', 'l', 10))
call assert_equal(3, strridx('hello', 'l', 3))
call assert_equal(2, strridx('hello', 'l', 2))
@@ -1219,7 +1230,7 @@ func Test_shellescape()
let save_shell = &shell
set shell=bash
call assert_equal("'text'", shellescape('text'))
- call assert_equal("'te\"xt'", shellescape('te"xt'))
+ call assert_equal("'te\"xt'", 'te"xt'->shellescape())
call assert_equal("'te'\\''xt'", shellescape("te'xt"))
call assert_equal("'te%xt'", shellescape("te%xt"))
@@ -1293,7 +1304,7 @@ endfunc
func Test_trim()
call assert_equal("Testing", trim(" \t\r\r\x0BTesting \t\n\r\n\t\x0B\x0B"))
- call assert_equal("Testing", trim(" \t \r\r\n\n\x0BTesting \t\n\r\n\t\x0B\x0B"))
+ call assert_equal("Testing", " \t \r\r\n\n\x0BTesting \t\n\r\n\t\x0B\x0B"->trim())
call assert_equal("RESERVE", trim("xyz \twwRESERVEzyww \t\t", " wxyz\t"))
call assert_equal("wRE \tSERVEzyww", trim("wRE \tSERVEzyww"))
call assert_equal("abcd\t xxxx tail", trim(" \tabcd\t xxxx tail"))
@@ -1330,7 +1341,7 @@ func Test_func_range_with_edit()
" is invalid in that buffer.
call writefile(['just one line'], 'Xfuncrange2')
new
- call setline(1, 10->range())
+ eval 10->range()->setline(1)
write Xfuncrange1
call assert_fails('5,8call EditAnotherFile()', 'E16:')
@@ -1560,7 +1571,7 @@ func Test_bufadd_bufload()
call assert_equal([''], getbufline(buf, 1, '$'))
let curbuf = bufnr('')
- call writefile(['some', 'text'], 'XotherName')
+ eval ['some', 'text']->writefile('XotherName')
let buf = 'XotherName'->bufadd()
call assert_notequal(0, buf)
eval 'XotherName'->bufexists()->assert_equal(1)
diff --git a/src/nvim/testdir/test_listchars.vim b/src/nvim/testdir/test_listchars.vim
index 9906b00222..f4ee539803 100644
--- a/src/nvim/testdir/test_listchars.vim
+++ b/src/nvim/testdir/test_listchars.vim
@@ -25,7 +25,7 @@ func Test_listchars()
redraw!
for i in range(1, 5)
call cursor(i, 1)
- call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
+ call assert_equal([expected[i - 1]], ScreenLines(i, '$'->virtcol()))
endfor
set listchars-=trail:<
diff --git a/src/nvim/testdir/test_marks.vim b/src/nvim/testdir/test_marks.vim
index 2fd82a4b6d..b3035d73ce 100644
--- a/src/nvim/testdir/test_marks.vim
+++ b/src/nvim/testdir/test_marks.vim
@@ -227,7 +227,7 @@ func Test_getmarklist()
call cursor(2, 2)
normal mr
call assert_equal({'mark' : "'r", 'pos' : [bufnr(), 2, 2, 0]},
- \ getmarklist(bufnr())[0])
- call assert_equal([], getmarklist({}))
+ \ bufnr()->getmarklist()[0])
+ call assert_equal([], {}->getmarklist())
close!
endfunc
diff --git a/src/nvim/testdir/test_matchadd_conceal_utf8.vim b/src/nvim/testdir/test_matchadd_conceal_utf8.vim
index 34c8c49dd5..7bfac13ad8 100644
--- a/src/nvim/testdir/test_matchadd_conceal_utf8.vim
+++ b/src/nvim/testdir/test_matchadd_conceal_utf8.vim
@@ -6,7 +6,7 @@ endif
function! s:screenline(lnum) abort
let line = []
for c in range(1, winwidth(0))
- call add(line, nr2char(screenchar(a:lnum, c)))
+ call add(line, nr2char(a:lnum->screenchar(c)))
endfor
return s:trim(join(line, ''))
endfunction
diff --git a/src/nvim/testdir/test_messages.vim b/src/nvim/testdir/test_messages.vim
index 08586dffe1..2140fe21ea 100644
--- a/src/nvim/testdir/test_messages.vim
+++ b/src/nvim/testdir/test_messages.vim
@@ -87,7 +87,7 @@ func Test_echoerr()
if has('float')
call assert_equal("\n1.23 IgNoRe", execute(':echoerr 1.23 "IgNoRe"'))
endif
- call test_ignore_error('<lambda>')
+ eval '<lambda>'->test_ignore_error()
call assert_match("function('<lambda>\\d*')", execute(':echoerr {-> 1234}'))
call test_ignore_error('RESET')
endfunc
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_prompt_buffer.vim b/src/nvim/testdir/test_prompt_buffer.vim
index 3da46eb1a6..c59a00afcc 100644
--- a/src/nvim/testdir/test_prompt_buffer.vim
+++ b/src/nvim/testdir/test_prompt_buffer.vim
@@ -165,9 +165,7 @@ func Test_prompt_buffer_getbufinfo()
call assert_equal('This is a test: ', prompt_getprompt('%'))
call prompt_setprompt( bufnr( '%' ), '' )
- " Nvim doesn't support method call syntax yet.
- " call assert_equal('', '%'->prompt_getprompt())
- call assert_equal('', prompt_getprompt('%'))
+ call assert_equal('', '%'->prompt_getprompt())
call prompt_setprompt( bufnr( '%' ), 'Another: ' )
call assert_equal('Another: ', prompt_getprompt('%'))
diff --git a/src/nvim/testdir/test_put.vim b/src/nvim/testdir/test_put.vim
index 8d8cc77025..f42b177c50 100644
--- a/src/nvim/testdir/test_put.vim
+++ b/src/nvim/testdir/test_put.vim
@@ -39,7 +39,7 @@ func Test_put_lines()
call assert_equal(['Line 3', '', 'Line 1', 'Line2'], getline(1, '$'))
" clean up
bw!
- call setreg('a', a[0], a[1])
+ eval a[0]->setreg('a', a[1])
endfunc
func Test_put_expr()
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index b38a59e98f..6db679c5f9 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -811,7 +811,7 @@ func Test_locationlist()
" NOTE: problem 1:
" intentionally not setting 'lnum' so that the quickfix entries are not
" valid
- call setloclist(0, qflist, ' ')
+ eval qflist->setloclist(0, ' ')
endfor
" Test A
@@ -1699,7 +1699,7 @@ endfunc
func Test_setqflist_invalid_nr()
" The following command used to crash Vim
- call setqflist([], ' ', {'nr' : $XXX_DOES_NOT_EXIST})
+ eval []->setqflist(' ', {'nr' : $XXX_DOES_NOT_EXIST})
endfunc
func Test_setqflist_user_sets_buftype()
diff --git a/src/nvim/testdir/test_ruby.vim b/src/nvim/testdir/test_ruby.vim
index 1a274d1fec..1fbf3392d9 100644
--- a/src/nvim/testdir/test_ruby.vim
+++ b/src/nvim/testdir/test_ruby.vim
@@ -60,7 +60,7 @@ func Test_ruby_set_cursor()
" Check that movement after setting cursor position keeps current column.
normal j
call assert_equal([2, 6], [line('.'), col('.')])
- call assert_equal([2, 5], rubyeval('$curwin.cursor'))
+ call assert_equal([2, 5], '$curwin.cursor'->rubyeval())
" call assert_fails('ruby $curwin.cursor = [1]',
" \ 'ArgumentError: array length must be 2')
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
index 7570049e7c..c796f1f676 100644
--- a/src/nvim/testdir/test_search.vim
+++ b/src/nvim/testdir/test_search.vim
@@ -1315,7 +1315,7 @@ func Test_search_match_at_curpos()
normal gg
- call search('foobar', 'c')
+ eval 'foobar'->search('c')
call assert_equal([1, 1], [line('.'), col('.')])
normal j
@@ -1354,6 +1354,41 @@ func Test_search_display_p