summaryrefslogtreecommitdiffstats
path: root/src/testdir/screendump.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-24 19:53:53 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-24 19:53:53 +0100
commit6bb2cdfe604e51eec216cbe23bb6e8fb47810347 (patch)
tree6d8ba5abf32abdd6df606bccd90d76aa359bd718 /src/testdir/screendump.vim
parentbb008dd3239c5fe3ac04501e38e4c950fa9426c8 (diff)
patch 8.0.1539: no test for the popup menu positioningv8.0.1539
Problem: No test for the popup menu positioning. Solution: Add a screendump test for the popup menu.
Diffstat (limited to 'src/testdir/screendump.vim')
-rw-r--r--src/testdir/screendump.vim20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/testdir/screendump.vim b/src/testdir/screendump.vim
index a28cb8cb89..584f9ac714 100644
--- a/src/testdir/screendump.vim
+++ b/src/testdir/screendump.vim
@@ -1,10 +1,23 @@
" Functions shared by tests making screen dumps.
" Only load this script once.
-if exists('*RunVimInTerminal')
+if exists('*CanRunVimInTerminal')
finish
endif
+" Need to be able to run terminal Vim with 256 colors. On MS-Windows the
+" console only has 16 colors and the GUI can't run in a terminal.
+if !has('terminal') || has('win32')
+ func CanRunVimInTerminal()
+ return 0
+ endfunc
+ finish
+endif
+
+func CanRunVimInTerminal()
+ return 1
+endfunc
+
source shared.vim
" Run Vim with "arguments" in a new terminal window.
@@ -41,16 +54,17 @@ func StopVimInTerminal(buf)
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".
" Will wait for up to a second for the screen dump to match.
-func VerifyScreenDump(buf, filename)
+func VerifyScreenDump(buf, filename, options)
let reference = 'dumps/' . a:filename . '.dump'
let testfile = a:filename . '.dump.failed'
let i = 0
while 1
call delete(testfile)
- call term_dumpwrite(a:buf, testfile)
+ call term_dumpwrite(a:buf, testfile, a:options)
if readfile(reference) == readfile(testfile)
call delete(testfile)
break