]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.2023: need more tests for :cq v9.0.2023
authorChristian Brabandt <cb@256bit.org>
Sat, 14 Oct 2023 09:38:12 +0000 (11:38 +0200)
committerChristian Brabandt <cb@256bit.org>
Sat, 14 Oct 2023 09:39:40 +0000 (11:39 +0200)
Problem:  need more tests for :cq
Solution: Add more tests, including wraparound on linux

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_startup.vim
src/version.c

index 949553350f0995b8bb4a10ca06a59c14b4d06b49..6780205a2dc112e0813dbb86a8302720a1ca082b 100644 (file)
@@ -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
index d842108880aabe4e25b4bc70e3983ac581f5fb13..8eb32e66386c226321fe293bd8182fbbceb6081c 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2023,
 /**/
     2022,
 /**/