]> granicus.if.org Git - vim/commitdiff
patch 8.1.1129: when making a new screendump test have to create the file v8.1.1129
authorBram Moolenaar <Bram@vim.org>
Sat, 6 Apr 2019 18:51:52 +0000 (20:51 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 6 Apr 2019 18:51:52 +0000 (20:51 +0200)
Problem:    When making a new screendump test have to create the file.
Solution:   Continue creating the failed screendump, so it can be moved once
            it is correct.

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

index 2d317fe161705fc3dd300f10bb3beaa41c5af1c3..d9789428106cad85393d490c7f49ae8332515188 100644 (file)
@@ -118,7 +118,12 @@ func VerifyScreenDump(buf, filename, options, ...)
     call delete(testfile)
     call term_dumpwrite(a:buf, testfile, a:options)
     let testdump = readfile(testfile)
-    let refdump = readfile(reference)
+    if filereadable(reference)
+      let refdump = readfile(reference)
+    else
+      " Must be a new screendump, always fail
+      let refdump = []
+    endif
     if refdump == testdump
       call delete(testfile)
       if did_mkdir
@@ -127,13 +132,17 @@ func VerifyScreenDump(buf, filename, options, ...)
       break
     endif
     if i == 100
-      " Leave the test file around for inspection.
-      let msg = 'See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")'
-      if a:0 == 1
-        let msg = a:1 . ': ' . msg
-      endif
-      if len(testdump) != len(refdump)
-       let msg = msg . '; line count is ' . len(testdump) . ' instead of ' . len(refdump)
+      " Leave the failed dump around for inspection.
+      if filereadable(reference)
+       let msg = 'See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")'
+       if a:0 == 1
+         let msg = a:1 . ': ' . msg
+       endif
+       if len(testdump) != len(refdump)
+         let msg = msg . '; line count is ' . len(testdump) . ' instead of ' . len(refdump)
+       endif
+      else
+       let msg = 'See new dump file: call term_dumpload("' . testfile . '")'
       endif
       for i in range(len(refdump))
        if i >= len(testdump)
index 51ae14c9e7be914d0bdb334c0700cf85685f65ca..5da9578bc34197b52191187ae3a3eff495dfbd19 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1129,
 /**/
     1128,
 /**/