From 8b633135106dda8605463b780573c45b00c22afe Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 20 Mar 2020 18:20:51 +0100 Subject: patch 8.2.0418: code in eval.c not sufficiently covered by tests Problem: Code in eval.c not sufficiently covered by tests. Solution: Add more tests. (Yegappan Lakshmanan, closes #5815) --- src/testdir/test_cmdline.vim | 55 +++----------------------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) (limited to 'src/testdir/test_cmdline.vim') diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index aa2681bf2..6a9888d8f 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -195,35 +195,6 @@ func Test_highlight_completion() call assert_equal([], getcompletion('A', 'highlight')) endfunc -func Test_expr_completion() - if !has('cmdline_compl') - return - endif - for cmd in [ - \ 'let a = ', - \ 'const a = ', - \ 'if', - \ 'elseif', - \ 'while', - \ 'for', - \ 'echo', - \ 'echon', - \ 'execute', - \ 'echomsg', - \ 'echoerr', - \ 'call', - \ 'return', - \ 'cexpr', - \ 'caddexpr', - \ 'cgetexpr', - \ 'lexpr', - \ 'laddexpr', - \ 'lgetexpr'] - call feedkeys(":" . cmd . " getl\\\"\", 'xt') - call assert_equal('"' . cmd . ' getline(', getreg(':')) - endfor -endfunc - func Test_getcompletion() if !has('cmdline_compl') return @@ -612,7 +583,7 @@ func Test_cmdline_complete_bang() endif endfunc -funct Test_cmdline_complete_languages() +func Test_cmdline_complete_languages() let lang = substitute(execute('language messages'), '.*"\(.*\)"$', '\1', '') call feedkeys(":language \\\"\", 'tx') @@ -636,10 +607,8 @@ endfunc func Test_cmdline_complete_env_variable() let $X_VIM_TEST_COMPLETE_ENV = 'foo' - call feedkeys(":edit $X_VIM_TEST_COMPLETE_E\\\"\", 'tx') call assert_match('"edit $X_VIM_TEST_COMPLETE_ENV', @:) - unlet $X_VIM_TEST_COMPLETE_ENV endfunc @@ -781,17 +750,13 @@ func Test_cmdline_complete_various() call feedkeys(":e `a1b2c\t\\"\", 'xt') call assert_equal('"e `a1b2c', @:) - " completion for the expression register - call feedkeys(":\"\=float2\t\"\\"\", 'xt') - call assert_equal('"float2nr("', @=) - " completion for :language command with an invalid argument call feedkeys(":language dummy \t\\"\", 'xt') call assert_equal("\"language dummy \t", @:) " completion for commands after a :global command - call feedkeys(":g/a\\xb/call float2\t\\"\", 'xt') - call assert_equal('"g/a\xb/call float2nr(', @:) + call feedkeys(":g/a\\xb/clearj\t\\"\", 'xt') + call assert_equal('"g/a\xb/clearjumps', @:) " completion with ambiguous user defined commands com TCmd1 echo 'TCmd1' @@ -804,20 +769,6 @@ func Test_cmdline_complete_various() " completion after a range followed by a pipe (|) character call feedkeys(":1,10 | chist\t\\"\", 'xt') call assert_equal('"1,10 | chistory', @:) - - " completion for window local variables - let w:wvar1 = 10 - let w:wvar2 = 10 - call feedkeys(":echo w:wvar\\\"\", 'xt') - call assert_equal('"echo w:wvar1 w:wvar2', @:) - unlet w:wvar1 w:wvar2 - - " completion for tab local variables - let t:tvar1 = 10 - let t:tvar2 = 10 - call feedkeys(":echo t:tvar\\\"\", 'xt') - call assert_equal('"echo t:tvar1 t:tvar2', @:) - unlet t:tvar1 t:tvar2 endfunc func Test_cmdline_write_alternatefile() -- cgit v1.2.1