Skip to content

Commit ef7f0e3

Browse files
committed
patch 8.1.1080: when a screendump test fails, moving the file is a hassle
Problem: When a screendump test fails, moving the file is a hassle. Solution: Instead of appending ".failed" to the file name, keep the same file name but put the screendump in the "failed" directory. Then the file name only needs to be typed once when moving a screendump.
1 parent 48aed08 commit ef7f0e3

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/testdir/screendump.vim

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ endfunc
103103
" Returns non-zero when verification fails.
104104
func VerifyScreenDump(buf, filename, options, ...)
105105
let reference = 'dumps/' . a:filename . '.dump'
106-
let testfile = a:filename . '.dump.failed'
106+
let testfile = 'failed/' . a:filename . '.dump'
107+
108+
let did_mkdir = 0
109+
if !isdirectory('failed')
110+
let did_mkdir = 1
111+
call mkdir('failed')
112+
endif
107113

108114
let i = 0
109115
while 1
@@ -115,6 +121,9 @@ func VerifyScreenDump(buf, filename, options, ...)
115121
let refdump = readfile(reference)
116122
if refdump == testdump
117123
call delete(testfile)
124+
if did_mkdir
125+
call delete('failed', 'd')
126+
endif
118127
break
119128
endif
120129
if i == 100

src/version.c

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

776776
static int included_patches[] =
777777
{ /* Add new patch number below this line */
778+
/**/
779+
1080,
778780
/**/
779781
1079,
780782
/**/

0 commit comments

Comments
 (0)