diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-09-09 22:02:24 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-09-09 22:02:24 +0200 |
commit | 6f8bdab8e2ffec07aea03447f87c80b50e01f430 (patch) | |
tree | 9fa0b4bc2ea02165d7c4839acfa9bf62206999c1 /src/testdir/screendump.vim | |
parent | a5c48c2698291e59244a705af1b7dbc60e03b09c (diff) | |
download | vim-git-6f8bdab8e2ffec07aea03447f87c80b50e01f430.tar.gz |
patch 8.1.0359: no clue what test failed when using a screendump twicev8.1.0359
Problem: No clue what test failed when using a screendump twice.
Solution: Add an extra argument to VerifyScreenDump().
Diffstat (limited to 'src/testdir/screendump.vim')
-rw-r--r-- | src/testdir/screendump.vim | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/testdir/screendump.vim b/src/testdir/screendump.vim index e601ae6cd..1b74c1b33 100644 --- a/src/testdir/screendump.vim +++ b/src/testdir/screendump.vim @@ -93,8 +93,11 @@ endfunc " Verify that Vim running in terminal buffer "buf" matches the screen dump. " "options" is passed to term_dumpwrite(). " The file name used is "dumps/{filename}.dump". +" Optionally an extra argument can be passed which is prepended to the error +" message. Use this when using the same dump file with different options. " Will wait for up to a second for the screen dump to match. -func VerifyScreenDump(buf, filename, options) +" Returns non-zero when verification fails. +func VerifyScreenDump(buf, filename, options, ...) let reference = 'dumps/' . a:filename . '.dump' let testfile = a:filename . '.dump.failed' @@ -108,10 +111,15 @@ func VerifyScreenDump(buf, filename, options) endif if i == 100 " Leave the test file around for inspection. - call assert_report('See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")') - break + let msg = 'See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")' + if a:0 == 1 + let msg = a:1 . ': ' . msg + endif + call assert_report(msg) + return 1 endif sleep 10m let i += 1 endwhile + return 0 endfunc |