diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-08-31 21:17:39 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-08-31 21:17:39 +0200 |
commit | f9f24ce7a0e5988fedf2e2ff751818f9b07510a6 (patch) | |
tree | af3ede78a2dedfa82536fb134d22dbe6c9a5033c /src/testdir/test_functions.vim | |
parent | 5d69fdb7c4b91faf2d92b8d449cc9460f3035fb3 (diff) |
patch 8.1.1953: more functions can be used as a methodv8.1.1953
Problem: More functions can be used as a method.
Solution: Allow more functions to be used as a method.
Diffstat (limited to 'src/testdir/test_functions.vim')
-rw-r--r-- | src/testdir/test_functions.vim | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 1352eaa5df..2ffdc24fb7 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -1069,7 +1069,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 @@ -1102,7 +1102,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) @@ -1279,7 +1279,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') @@ -1295,6 +1295,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_libcall_libcallnr() if !has('libcall') return |