aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_quickfix.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_quickfix.vim')
-rw-r--r--src/nvim/testdir/test_quickfix.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index 9c5f0777c6..5c84e45a79 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -3,6 +3,8 @@
source check.vim
CheckFeature quickfix
+source screendump.vim
+
set encoding=utf-8
func s:setup_commands(cchar)
@@ -4410,6 +4412,31 @@ func Test_search_in_dirstack()
call delete('Xtestdir', 'rf')
endfunc
+" Test for :cquit
+func Test_cquit()
+ " Exit Vim with a non-zero value
+ if RunVim([], ["cquit 7"], '')
+ call assert_equal(7, v:shell_error)
+ endif
+
+ if RunVim([], ["50cquit"], '')
+ call assert_equal(50, v:shell_error)
+ endif
+
+ " Exit Vim with default value
+ if RunVim([], ["cquit"], '')
+ call assert_equal(1, v:shell_error)
+ endif
+
+ " Exit Vim with zero value
+ if RunVim([], ["cquit 0"], '')
+ call assert_equal(0, v:shell_error)
+ endif
+
+ " Exit Vim with negative value
+ call assert_fails('-3cquit', 'E16:')
+endfunc
+
" Test for adding an invalid entry with the quickfix window open and making
" sure that the window contents are not changed
func Test_add_invalid_entry_with_qf_window()