summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_startup.vim
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2023-10-14 11:38:12 +0200
committerChristian Brabandt <cb@256bit.org>2023-10-14 11:39:40 +0200
commitba9aed44975cc82290208fd45f35dd72fc66d6c1 (patch)
treef93f6cc7f354e560335aaba2c706408a512cdabc /src/testdir/test_startup.vim
parentb583eda7031b1f6a3469a2537d0c10ca5fa5568e (diff)
patch 9.0.2023: need more tests for :cqv9.0.2023
Problem: need more tests for :cq Solution: Add more tests, including wraparound on linux Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir/test_startup.vim')
-rw-r--r--src/testdir/test_startup.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim
index 949553350f..6780205a2d 100644
--- a/src/testdir/test_startup.vim
+++ b/src/testdir/test_startup.vim
@@ -1351,5 +1351,25 @@ func Test_rename_buffer_on_startup()
call delete('Xresult')
endfunc
+" Test that -cq works as expected
+func Test_cq_zero_exmode()
+ let logfile = 'Xcq_log.txt'
+ let out = system(GetVimCommand() .. ' --clean --log ' .. logfile .. ' -es -X -c "argdelete foobar" -c"7cq"')
+ call assert_equal(8, v:shell_error)
+ let log = filter(readfile(logfile), {idx, val -> val =~ "E480"})
+ call assert_match('E480: No match: foobar', log[0])
+ call delete(logfile)
+
+ " wrap-around on Unix
+ let out = system(GetVimCommand() .. ' --clean --log ' .. logfile .. ' -es -X -c "argdelete foobar" -c"255cq"')
+ if !has('win32')
+ call assert_equal(0, v:shell_error)
+ else
+ call assert_equal(256, v:shell_error)
+ endif
+ let log = filter(readfile(logfile), {idx, val -> val =~ "E480"})
+ call assert_match('E480: No match: foobar', log[0])
+ call delete('Xcq_log.txt')
+endfunc
" vim: shiftwidth=2 sts=2 expandtab