diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-01-06 21:47:21 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-01-06 21:47:21 +0100 |
commit | 1860bde9d31bbb0ba857f6284f6332a7134030dd (patch) | |
tree | e1b03b951134208584dac0c507a53fee06e42b7d /src/testdir | |
parent | e73b38f8e10c220a382270f69e24cad08d3bf792 (diff) | |
download | vim-git-1860bde9d31bbb0ba857f6284f6332a7134030dd.tar.gz |
patch 8.2.0095: cannot specify exit code for :cquitv8.2.0095
Problem: Cannot specify exit code for :cquit.
Solution: Add optional argument. (Thinca, Yegappan Lakshmanan, closes #5442)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_quickfix.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index f7c73f4c3..b7b428196 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -4674,4 +4674,29 @@ 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 + " vim: shiftwidth=2 sts=2 expandtab |