summaryrefslogtreecommitdiffstats
path: root/src/testdir/screendump.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-04-06 20:51:52 +0200
committerBram Moolenaar <Bram@vim.org>2019-04-06 20:51:52 +0200
commit2d7260d66575052124b76c8b97b957319111bfef (patch)
tree821227ba1e465adc129725b6cff8349497f55e04 /src/testdir/screendump.vim
parent94a7242ad1c41cc2a5377535f81d29a5b374b983 (diff)
patch 8.1.1129: when making a new screendump test have to create the filev8.1.1129
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.
Diffstat (limited to 'src/testdir/screendump.vim')
-rw-r--r--src/testdir/screendump.vim25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/testdir/screendump.vim b/src/testdir/screendump.vim
index 2d317fe161..d978942810 100644
--- a/src/testdir/screendump.vim
+++ b/src/testdir/screendump.vim
@@ -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)