diff src/testdir/test_popupwin.vim @ 17241:3ada3d207b33 v8.1.1620

patch 8.1.1620: no test for popup window with border and mask commit https://github.com/vim/vim/commit/ba45f1f4fbff1a78ed5786c2608b0f8a76ec53c8 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 3 22:50:41 2019 +0200 patch 8.1.1620: no test for popup window with border and mask Problem: No test for popup window with border and mask. Solution: Add this popup window, fix problems.
author Bram Moolenaar <Bram@vim.org>
date Wed, 03 Jul 2019 23:00:09 +0200
parents 2a97167854fc
children 13a2d3364b3f
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -427,13 +427,13 @@ func Test_popup_with_mask()
     throw 'Skipped: cannot make screendumps'
   endif
   let lines =<< trim END
-	call setline(1, repeat([join(range(1, 42), '')], 10))
+	call setline(1, repeat([join(range(1, 42), '')], 13))
 	hi PopupColor ctermbg=lightgrey
 	let winid = popup_create([
 	    \ 'some text',
 	    \ 'another line',
 	    \], {
-	    \ 'line': 2,
+	    \ 'line': 1,
 	    \ 'col': 10,
 	    \ 'wrap': 0,
 	    \ 'fixed': 1,
@@ -448,18 +448,33 @@ func Test_popup_with_mask()
 	    \ 'line': 3,
 	    \ 'col': 18,
 	    \ 'zindex': 20})
+	let winidb = popup_create([
+	    \ 'just one line',
+	    \], {
+	    \ 'line': 7,
+	    \ 'col': 10,
+	    \ 'wrap': 0,
+	    \ 'fixed': 1,
+	    \ 'close': 'button',
+	    \ 'zindex': 90,
+	    \ 'padding': [],
+	    \ 'border': [],
+	    \ 'mask': [[1,2,1,1], [-5,-1,4,4], [7,9,2,3], [3,5,5,5],[-7,-4,5,5]]})
   END
   call writefile(lines, 'XtestPopupMask')
-  let buf = RunVimInTerminal('-S XtestPopupMask', {'rows': 10})
+  let buf = RunVimInTerminal('-S XtestPopupMask', {'rows': 13})
   call VerifyScreenDump(buf, 'Test_popupwin_mask_1', {})
 
-  call term_sendkeys(buf, ":call popup_move(winid, {'col': 11, 'line': 3})\<CR>")
+  call term_sendkeys(buf, ":call popup_move(winid, {'col': 11, 'line': 2})\<CR>")
+  call term_sendkeys(buf, ":call popup_move(winidb, {'col': 12})\<CR>")
   call VerifyScreenDump(buf, 'Test_popupwin_mask_2', {})
 
-  call term_sendkeys(buf, ":call popup_move(winid, {'col': 65, 'line': 3})\<CR>")
+  call term_sendkeys(buf, ":call popup_move(winid, {'col': 65, 'line': 2})\<CR>")
+  call term_sendkeys(buf, ":call popup_move(winidb, {'col': 63})\<CR>")
   call VerifyScreenDump(buf, 'Test_popupwin_mask_3', {})
 
-  call term_sendkeys(buf, ":call popup_move(winid, {'pos': 'topright', 'col': 12, 'line': 3})\<CR>")
+  call term_sendkeys(buf, ":call popup_move(winid, {'pos': 'topright', 'col': 12, 'line': 2})\<CR>")
+  call term_sendkeys(buf, ":call popup_move(winidb, {'pos': 'topright', 'col': 12})\<CR>")
   call VerifyScreenDump(buf, 'Test_popupwin_mask_4', {})
 
   " clean up