Skip to content

Commit

Permalink
patch 8.1.1080: when a screendump test fails, moving the file is a ha…
Browse files Browse the repository at this point in the history
…ssle

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.
  • Loading branch information
brammool committed Mar 30, 2019
1 parent 48aed08 commit ef7f0e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/testdir/screendump.vim
Expand Up @@ -103,7 +103,13 @@ endfunc
" Returns non-zero when verification fails.
func VerifyScreenDump(buf, filename, options, ...)
let reference = 'dumps/' . a:filename . '.dump'
let testfile = a:filename . '.dump.failed'
let testfile = 'failed/' . a:filename . '.dump'

let did_mkdir = 0
if !isdirectory('failed')
let did_mkdir = 1
call mkdir('failed')
endif

let i = 0
while 1
Expand All @@ -115,6 +121,9 @@ func VerifyScreenDump(buf, filename, options, ...)
let refdump = readfile(reference)
if refdump == testdump
call delete(testfile)
if did_mkdir
call delete('failed', 'd')
endif
break
endif
if i == 100
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -775,6 +775,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1080,
/**/
1079,
/**/
Expand Down

0 comments on commit ef7f0e3

Please sign in to comment.