]> granicus.if.org Git - vim/commitdiff
patch 8.1.1080: when a screendump test fails, moving the file is a hassle v8.1.1080
authorBram Moolenaar <Bram@vim.org>
Sat, 30 Mar 2019 14:59:51 +0000 (15:59 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 30 Mar 2019 14:59:51 +0000 (15:59 +0100)
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.

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

index cea0e1b17fa267073900fe85e94041eb77b36fd1..2d317fe161705fc3dd300f10bb3beaa41c5af1c3 100644 (file)
@@ -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
@@ -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
index d8a65cd3b0965eef244d915eb1b7e975a13fbe59..508736a44bcca14670b29bfe619f2dade4c5f4a9 100644 (file)
@@ -775,6 +775,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1080,
 /**/
     1079,
 /**/