summaryrefslogtreecommitdiff
path: root/src/testdir/test_popupwin_textprop.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-25 23:08:17 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-25 23:08:17 +0200
commit8e95636a282f3eac808c0e00c053b33334cc283e (patch)
treef2fdaf570a335324d8e861b68e2e632d32a0b07c /src/testdir/test_popupwin_textprop.vim
parent12034e22dd80cf533ac1c681be521ab299383f63 (diff)
downloadvim-git-8e95636a282f3eac808c0e00c053b33334cc283e.tar.gz
patch 8.1.1929: no tests for text property popup windowv8.1.1929
Problem: No tests for text property popup window. Solution: Add a few tests.
Diffstat (limited to 'src/testdir/test_popupwin_textprop.vim')
-rw-r--r--src/testdir/test_popupwin_textprop.vim54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin_textprop.vim b/src/testdir/test_popupwin_textprop.vim
new file mode 100644
index 000000000..26950de96
--- /dev/null
+++ b/src/testdir/test_popupwin_textprop.vim
@@ -0,0 +1,54 @@
+" Tests for popup windows for text properties
+
+source check.vim
+CheckFeature textprop
+
+source screendump.vim
+CheckScreendump
+
+func Test_textprop_popup()
+ let lines =<< trim END
+ call setline(1, range(1, 100))
+ call setline(50, 'some text to work with')
+ 50
+ normal zz
+ set scrolloff=0
+ call prop_type_add('popupMarker', #{highlight: 'DiffAdd'})
+ call prop_add(50, 11, #{
+ \ length: 7,
+ \ type: 'popupMarker',
+ \ })
+ let winid = popup_create('the text', #{
+ \ pos: 'botleft',
+ \ textprop: 'popupMarker',
+ \ border: [],
+ \ padding: [0,1,0,1],
+ \ close: 'click',
+ \ })
+ END
+ call writefile(lines, 'XtestTextpropPopup')
+ let buf = RunVimInTerminal('-S XtestTextpropPopup', #{rows: 10})
+ call VerifyScreenDump(buf, 'Test_popup_textprop_01', {})
+
+ call term_sendkeys(buf, "zt")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_02', {})
+
+ call term_sendkeys(buf, "zzIawe\<Esc>")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_03', {})
+
+ call term_sendkeys(buf, "0dw")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_04', {})
+
+ call term_sendkeys(buf, "Oinserted\<Esc>")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_05', {})
+
+ call term_sendkeys(buf, "k2dd")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_06', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('XtestTextpropPopup')
+endfunc
+
+
+" vim: shiftwidth=2 sts=2