diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.lua | 36 | ||||
-rw-r--r-- | src/nvim/testdir/test_breakindent.vim | 6 | ||||
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 25 | ||||
-rw-r--r-- | src/nvim/testdir/test_getcwd.vim | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_history.vim | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test_listdict.vim | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_syn_attr.vim | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_true_false.vim | 2 |
8 files changed, 51 insertions, 32 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index cc38a0734e..f600b4ce06 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -183,32 +183,32 @@ return { globpath={args={2, 5}, base=2}, has={args=1}, has_key={args=2, base=1}, - haslocaldir={args={0,2}}, - hasmapto={args={1, 3}}, - highlightID={args=1, func='f_hlID'}, -- obsolete - highlight_exists={args=1, func='f_hlexists'}, -- obsolete - histadd={args=2}, - histdel={args={1, 2}}, - histget={args={1, 2}}, - histnr={args=1}, - hlID={args=1}, - hlexists={args=1}, + haslocaldir={args={0, 2}, base=1}, + hasmapto={args={1, 3}, base=1}, + highlightID={args=1, base=1, func='f_hlID'}, -- obsolete + highlight_exists={args=1, base=1, func='f_hlexists'}, -- obsolete + histadd={args=2, base=2}, + histdel={args={1, 2}, base=1}, + histget={args={1, 2}, base=1}, + histnr={args=1, base=1}, + hlID={args=1, base=1}, + hlexists={args=1, base=1}, hostname={}, - iconv={args=3}, - indent={args=1}, + iconv={args=3, base=1}, + indent={args=1, base=1}, index={args={2, 4}, base=1}, - input={args={1, 3}}, - inputdialog={args={1, 3}}, - inputlist={args=1}, + input={args={1, 3}, base=1}, + inputdialog={args={1, 3}, base=1}, + inputlist={args=1, base=1}, inputrestore={}, inputsave={}, - inputsecret={args={1, 2}}, + inputsecret={args={1, 2}, base=1}, insert={args={2, 3}, base=1}, interrupt={args=0}, invert={args=1, base=1}, - isdirectory={args=1}, + isdirectory={args=1, base=1}, isinf={args=1, base=1}, - islocked={args=1}, + islocked={args=1, base=1}, isnan={args=1, base=1}, id={args=1}, items={args=1, base=1}, diff --git a/src/nvim/testdir/test_breakindent.vim b/src/nvim/testdir/test_breakindent.vim index 97b570e64f..277050876e 100644 --- a/src/nvim/testdir/test_breakindent.vim +++ b/src/nvim/testdir/test_breakindent.vim @@ -418,8 +418,8 @@ endfunc func Test_breakindent11() " test strdisplaywidth() call s:test_windows('setl cpo-=n sbr=>> nu nuw=4 nolist briopt= ts=4') - let text=getline(2) - let width = strlen(text[1:])+indent(2)+strlen(&sbr)*3 " text wraps 3 times + let text = getline(2) + let width = strlen(text[1:]) + indent(2) + strlen(&sbr) * 3 " text wraps 3 times call assert_equal(width, strdisplaywidth(text)) call s:close_windows('set sbr=') endfunc @@ -431,7 +431,7 @@ func Test_breakindent11_vartabs() " test strdisplaywidth() 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:])+indent(2)+strlen(&sbr)*3 " text wraps 3 times + let width = strlen(text[1:]) + 2->indent() + strlen(&sbr) * 3 " text wraps 3 times call assert_equal(width, strdisplaywidth(text)) call s:close_windows('set sbr= vts&') endfunc diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index e3a80be6d5..90732549de 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1127,7 +1127,7 @@ endfunc func Test_hlexists() call assert_equal(0, hlexists('does_not_exist')) - " call assert_equal(0, hlexists('Number')) + " call assert_equal(0, 'Number'->hlexists()) call assert_equal(0, highlight_exists('does_not_exist')) " call assert_equal(0, highlight_exists('Number')) syntax on @@ -1160,7 +1160,7 @@ endfunc func Test_inputlist() call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\<cr>1\<cr>", 'tx') call assert_equal(1, c) - call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\<cr>2\<cr>", 'tx') + call feedkeys(":let c = ['Select color:', '1. red', '2. green', '3. blue']->inputlist()\<cr>2\<cr>", 'tx') call assert_equal(2, c) call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\<cr>3\<cr>", 'tx') call assert_equal(3, c) @@ -1413,7 +1413,7 @@ func Test_reg_executing_and_recording() let g:regs = [] func TestFunc() abort let g:regs += [reg_executing()] - let g:typed = input('?') + let g:typed = '?'->input() let g:regs += [reg_executing()] endfunc call feedkeys("@qy\<CR>", 'xt') @@ -1429,6 +1429,25 @@ func Test_reg_executing_and_recording() unlet s:reg_stat endfunc +func Test_inputsecret() + map W :call TestFunc()<CR> + let @q = "W" + let g:typed1 = '' + let g:typed2 = '' + let g:regs = [] + func TestFunc() abort + let g:typed1 = '?'->inputsecret() + let g:typed2 = inputsecret('password: ') + endfunc + call feedkeys("@qsomething\<CR>else\<CR>", 'xt') + call assert_equal("something", g:typed1) + call assert_equal("else", g:typed2) + delfunc TestFunc + unmap W + unlet g:typed1 + unlet g:typed2 +endfunc + func Test_getchar() call feedkeys('a', '') call assert_equal(char2nr('a'), getchar()) diff --git a/src/nvim/testdir/test_getcwd.vim b/src/nvim/testdir/test_getcwd.vim index ca098781e4..b9343b1daa 100644 --- a/src/nvim/testdir/test_getcwd.vim +++ b/src/nvim/testdir/test_getcwd.vim @@ -17,7 +17,7 @@ func GetCwdInfo(win, tab) let lflag = haslocaldir(a:win) else let dirname = fnamemodify(getcwd(a:win, a:tab), mod) - let lflag = haslocaldir(a:win, a:tab) + let lflag = a:win->haslocaldir(a:tab) endif return bufname . ' ' . dirname . ' ' . lflag endfunc diff --git a/src/nvim/testdir/test_history.vim b/src/nvim/testdir/test_history.vim index 16aad9889e..2f0dc2dae1 100644 --- a/src/nvim/testdir/test_history.vim +++ b/src/nvim/testdir/test_history.vim @@ -13,7 +13,7 @@ function History_Tests(hist) call assert_equal(-1, histnr(a:hist)) call assert_equal('', histget(a:hist)) - call assert_true(histadd(a:hist, 'ls')) + call assert_true('ls'->histadd(a:hist)) call assert_true(histadd(a:hist, 'buffers')) call assert_equal('buffers', histget(a:hist)) call assert_equal('ls', histget(a:hist, -2)) @@ -22,14 +22,14 @@ function History_Tests(hist) call assert_equal('', histget(a:hist, -5)) call assert_equal(2, histnr(a:hist)) call assert_true(histdel(a:hist, 2)) - call assert_false(histdel(a:hist, 7)) + call assert_false(a:hist->histdel(7)) call assert_equal(1, histnr(a:hist)) call assert_equal('ls', histget(a:hist, -1)) call assert_true(histadd(a:hist, 'buffers')) call assert_true(histadd(a:hist, 'ls')) - call assert_equal('ls', histget(a:hist, -1)) - call assert_equal(4, histnr(a:hist)) + call assert_equal('ls', a:hist->histget(-1)) + call assert_equal(4, a:hist->histnr()) let a=execute('history ' . a:hist) call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a) diff --git a/src/nvim/testdir/test_listdict.vim b/src/nvim/testdir/test_listdict.vim index ae035fa519..f6c404d390 100644 --- a/src/nvim/testdir/test_listdict.vim +++ b/src/nvim/testdir/test_listdict.vim @@ -573,7 +573,7 @@ func Test_lockvar_script_autoload() set rtp+=./sautest lockvar g:footest#x unlockvar g:footest#x - call assert_equal(-1, islocked('g:footest#x')) + call assert_equal(-1, 'g:footest#x'->islocked()) call assert_equal(0, exists('g:footest#x')) call assert_equal(1, g:footest#x) let &rtp = old_rtp diff --git a/src/nvim/testdir/test_syn_attr.vim b/src/nvim/testdir/test_syn_attr.vim index 353054fec8..fa0b08fde5 100644 --- a/src/nvim/testdir/test_syn_attr.vim +++ b/src/nvim/testdir/test_syn_attr.vim @@ -8,7 +8,7 @@ func Test_missing_attr() call assert_equal('1', synIDattr(hlID("Mine"), "inverse", 'cterm')) hi Mine cterm=standout gui=undercurl call assert_equal('1', synIDattr(hlID("Mine"), "standout", 'cterm')) - call assert_equal('1', synIDattr(hlID("Mine"), "undercurl", 'gui')) + call assert_equal('1', synIDattr("Mine"->hlID(), "undercurl", 'gui')) hi Mine gui=strikethrough call assert_equal('1', synIDattr(hlID("Mine"), "strikethrough", 'gui')) hi Mine cterm=NONE gui=NONE diff --git a/src/nvim/testdir/test_true_false.vim b/src/nvim/testdir/test_true_false.vim index 315ba188cb..f3c7fff4a6 100644 --- a/src/nvim/testdir/test_true_false.vim +++ b/src/nvim/testdir/test_true_false.vim @@ -104,7 +104,7 @@ func Test_true_false_arg() call Try_arg_true_false('maparg("asdf", "i", %v%)', "", "asdff") call Try_arg_true_false('FilterMapArg(maparg("asdf", "i", 1, %v%))', "asdff", {'rhs': 'asdff'}) - call Try_arg_true_false('hasmapto("asdf", "i", %v%)', 0, 1) + call Try_arg_true_false('"asdf"->hasmapto("i", %v%)', 0, 1) new colored call setline(1, '<here>') |