diff src/testdir/screendump.vim @ 13329:424321d6eea7 v8.0.1539

patch 8.0.1539: no test for the popup menu positioning commit https://github.com/vim/vim/commit/6bb2cdfe604e51eec216cbe23bb6e8fb47810347 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 24 19:53:53 2018 +0100 patch 8.0.1539: no test for the popup menu positioning Problem: No test for the popup menu positioning. Solution: Add a screendump test for the popup menu.
author Christian Brabandt <cb@256bit.org>
date Sat, 24 Feb 2018 20:00:07 +0100
parents 0dc2e4998a15
children 1ba4f926247c
line wrap: on
line diff
--- 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