comparison src/testdir/test_popupwin_textprop.vim @ 17865:eaf8b21d80e7 v8.1.1929

patch 8.1.1929: no tests for text property popup window Commit: https://github.com/vim/vim/commit/8e95636a282f3eac808c0e00c053b33334cc283e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 25 23:08:17 2019 +0200 patch 8.1.1929: no tests for text property popup window Problem: No tests for text property popup window. Solution: Add a few tests.
author Bram Moolenaar <Bram@vim.org>
date Sun, 25 Aug 2019 23:15:03 +0200
parents
children f13a5c48320b
comparison
equal deleted inserted replaced
17864:2887514e731f 17865:eaf8b21d80e7
1 " Tests for popup windows for text properties
2
3 source check.vim
4 CheckFeature textprop
5
6 source screendump.vim
7 CheckScreendump
8
9 func Test_textprop_popup()
10 let lines =<< trim END
11 call setline(1, range(1, 100))
12 call setline(50, 'some text to work with')
13 50
14 normal zz
15 set scrolloff=0
16 call prop_type_add('popupMarker', #{highlight: 'DiffAdd'})
17 call prop_add(50, 11, #{
18 \ length: 7,
19 \ type: 'popupMarker',
20 \ })
21 let winid = popup_create('the text', #{
22 \ pos: 'botleft',
23 \ textprop: 'popupMarker',
24 \ border: [],
25 \ padding: [0,1,0,1],
26 \ close: 'click',
27 \ })
28 END
29 call writefile(lines, 'XtestTextpropPopup')
30 let buf = RunVimInTerminal('-S XtestTextpropPopup', #{rows: 10})
31 call VerifyScreenDump(buf, 'Test_popup_textprop_01', {})
32
33 call term_sendkeys(buf, "zt")
34 call VerifyScreenDump(buf, 'Test_popup_textprop_02', {})
35
36 call term_sendkeys(buf, "zzIawe\<Esc>")
37 call VerifyScreenDump(buf, 'Test_popup_textprop_03', {})
38
39 call term_sendkeys(buf, "0dw")
40 call VerifyScreenDump(buf, 'Test_popup_textprop_04', {})
41
42 call term_sendkeys(buf, "Oinserted\<Esc>")
43 call VerifyScreenDump(buf, 'Test_popup_textprop_05', {})
44
45 call term_sendkeys(buf, "k2dd")
46 call VerifyScreenDump(buf, 'Test_popup_textprop_06', {})
47
48 " clean up
49 call StopVimInTerminal(buf)
50 call delete('XtestTextpropPopup')
51 endfunc
52
53
54 " vim: shiftwidth=2 sts=2