]> granicus.if.org Git - vim/commitdiff
patch 8.1.0359: no clue what test failed when using a screendump twice v8.1.0359
authorBram Moolenaar <Bram@vim.org>
Sun, 9 Sep 2018 20:02:24 +0000 (22:02 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 9 Sep 2018 20:02:24 +0000 (22:02 +0200)
Problem:    No clue what test failed when using a screendump twice.
Solution:   Add an extra argument to VerifyScreenDump().

src/testdir/screendump.vim
src/version.c

index e601ae6cd3194756318312cdab168d091a2362d5..1b74c1b33ea49a04247421edc9ad981fa9695e69 100644 (file)
@@ -93,8 +93,11 @@ endfunc
 " Verify that Vim running in terminal buffer "buf" matches the screen dump.
 " "options" is passed to term_dumpwrite().
 " The file name used is "dumps/{filename}.dump".
+" Optionally an extra argument can be passed which is prepended to the error
+" message.  Use this when using the same dump file with different options.
 " Will wait for up to a second for the screen dump to match.
-func VerifyScreenDump(buf, filename, options)
+" Returns non-zero when verification fails.
+func VerifyScreenDump(buf, filename, options, ...)
   let reference = 'dumps/' . a:filename . '.dump'
   let testfile = a:filename . '.dump.failed'
 
@@ -108,10 +111,15 @@ func VerifyScreenDump(buf, filename, options)
     endif
     if i == 100
       " Leave the test file around for inspection.
-      call assert_report('See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")')
-      break
+      let msg = 'See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")'
+      if a:0 == 1
+       let msg = a:1 . ': ' . msg
+      endif
+      call assert_report(msg)
+      return 1
     endif
     sleep 10m
     let i += 1
   endwhile
+  return 0
 endfunc
index 67bfbd164499a6aefbb927ab615178b49c9702bc..73bcab10941cefd262d48cd6716b497e7aa9ec90 100644 (file)
@@ -794,6 +794,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    359,
 /**/
     358,
 /**/