diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-17 15:53:24 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-04-17 15:53:24 +0100 |
commit | 961b2e54bdbe1c06e4bf8ccf7a7e3deb129b45de (patch) | |
tree | b031a7ff41162ab767a027ceadfc7442e1755a87 /src/testdir/test_cmdline.vim | |
parent | e7d49465a4ad390c1b0fb6d6b97bc30241fe5db9 (diff) |
patch 9.0.1460: insufficient testing for getcmdcompltype()v9.0.1460
Problem: Insufficient testing for getcmdcompltype().
Solution: Add a few more test cases. (closes #12268)
Diffstat (limited to 'src/testdir/test_cmdline.vim')
-rw-r--r-- | src/testdir/test_cmdline.vim | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 8b47d86e1c..8b717b7c2d 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -3337,16 +3337,23 @@ func Test_cmdline_complete_bang_cmd_argument() call assert_equal('"!vim test_cmdline.vim', @:) endfunc -func Check_completion() - call assert_equal('let a', getcmdline()) - call assert_equal(6, getcmdpos()) - call assert_equal(7, getcmdscreenpos()) - call assert_equal('var', getcmdcompltype()) - return '' +func Call_cmd_funcs() + return string([getcmdpos(), getcmdscreenpos(), getcmdcompltype()]) endfunc func Test_screenpos_and_completion() - call feedkeys(":let a\<C-R>=Check_completion()\<CR>\<Esc>", "xt") + call assert_equal(0, getcmdpos()) + call assert_equal(0, getcmdscreenpos()) + call assert_equal('', getcmdcompltype()) + + cnoremap <expr> <F2> string([getcmdpos(), getcmdscreenpos(), getcmdcompltype()]) + call feedkeys(":let a\<F2>\<C-B>\"\<CR>", "xt") + call assert_equal("\"let a[6, 7, 'var']", @:) + call feedkeys(":quit \<F2>\<C-B>\"\<CR>", "xt") + call assert_equal("\"quit [6, 7, '']", @:) + call feedkeys(":nosuchcommand \<F2>\<C-B>\"\<CR>", "xt") + call assert_equal("\"nosuchcommand [15, 16, '']", @:) + cunmap <F2> endfunc func Test_recursive_register() |