Skip to content

Commit 2d7260d

Browse files
committed
patch 8.1.1129: when making a new screendump test have to create the file
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.
1 parent 94a7242 commit 2d7260d

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

src/testdir/screendump.vim

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ func VerifyScreenDump(buf, filename, options, ...)
118118
call delete(testfile)
119119
call term_dumpwrite(a:buf, testfile, a:options)
120120
let testdump = readfile(testfile)
121-
let refdump = readfile(reference)
121+
if filereadable(reference)
122+
let refdump = readfile(reference)
123+
else
124+
" Must be a new screendump, always fail
125+
let refdump = []
126+
endif
122127
if refdump == testdump
123128
call delete(testfile)
124129
if did_mkdir
@@ -127,13 +132,17 @@ func VerifyScreenDump(buf, filename, options, ...)
127132
break
128133
endif
129134
if i == 100
130-
" Leave the test file around for inspection.
131-
let msg = 'See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")'
132-
if a:0 == 1
133-
let msg = a:1 . ': ' . msg
134-
endif
135-
if len(testdump) != len(refdump)
136-
let msg = msg . '; line count is ' . len(testdump) . ' instead of ' . len(refdump)
135+
" Leave the failed dump around for inspection.
136+
if filereadable(reference)
137+
let msg = 'See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")'
138+
if a:0 == 1
139+
let msg = a:1 . ': ' . msg
140+
endif
141+
if len(testdump) != len(refdump)
142+
let msg = msg . '; line count is ' . len(testdump) . ' instead of ' . len(refdump)
143+
endif
144+
else
145+
let msg = 'See new dump file: call term_dumpload("' . testfile . '")'
137146
endif
138147
for i in range(len(refdump))
139148
if i >= len(testdump)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1129,
774776
/**/
775777
1128,
776778
/**/

0 commit comments

Comments
 (0)