patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Problem: Insufficient code coverage for ex_docmd.c functions.
Solution: Add more tests. (Yegappan Lakshmanan, closes #5618)
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim
index 3f4574a..cc5ee80 100644
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -2725,10 +2725,6 @@
call assert_equal(0, getbufinfo('Xtestfile1')[0].loaded)
call assert_equal([], getbufinfo('Xtestfile2'))
- " Test with the last search pattern not set
- call test_clear_search_pat()
- call assert_fails('Xvimgrep // *', 'E35:')
-
call delete('Xtestfile1')
call delete('Xtestfile2')
endfunc
@@ -2754,6 +2750,21 @@
set noincsearch
endfunc
+" Test vimgrep with the last search pattern not set
+func Test_vimgrep_with_no_last_search_pat()
+ let lines =<< trim [SCRIPT]
+ call assert_fails('vimgrep // *', 'E35:')
+ call writefile(v:errors, 'Xresult')
+ qall!
+ [SCRIPT]
+ call writefile(lines, 'Xscript')
+ if RunVim([], [], '--clean -S Xscript')
+ call assert_equal([], readfile('Xresult'))
+ endif
+ call delete('Xscript')
+ call delete('Xresult')
+endfunc
+
func XfreeTests(cchar)
call s:setup_commands(a:cchar)