Mercurial > vim
annotate src/testdir/test_popupwin_textprop.vim @ 17877:642832e45388 v8.1.1935
patch 8.1.1935: test for text property popup window is flaky
Commit: https://github.com/vim/vim/commit/57441d6fa0ba44be8dc16d6469a8659afc2f3b81
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 28 22:38:07 2019 +0200
patch 8.1.1935: test for text property popup window is flaky
Problem: Test for text property popup window is flaky.
Solution: Remove the undo message
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 28 Aug 2019 22:45:03 +0200 |
parents | f13a5c48320b |
children | 5d5b460926ca |
rev | line source |
---|---|
17865
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Tests for popup windows for text properties |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 source check.vim |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 CheckFeature textprop |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 source screendump.vim |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 CheckScreendump |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 func Test_textprop_popup() |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 let lines =<< trim END |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 call setline(1, range(1, 100)) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 call setline(50, 'some text to work with') |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 50 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 normal zz |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 set scrolloff=0 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 call prop_type_add('popupMarker', #{highlight: 'DiffAdd'}) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 call prop_add(50, 11, #{ |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 \ length: 7, |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 \ type: 'popupMarker', |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 \ }) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 let winid = popup_create('the text', #{ |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 \ pos: 'botleft', |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 \ textprop: 'popupMarker', |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
24 \ border: [], |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
25 \ padding: [0,1,0,1], |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
26 \ close: 'click', |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 \ }) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
28 END |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 call writefile(lines, 'XtestTextpropPopup') |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
30 let buf = RunVimInTerminal('-S XtestTextpropPopup', #{rows: 10}) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
31 call VerifyScreenDump(buf, 'Test_popup_textprop_01', {}) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 call term_sendkeys(buf, "zt") |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 call VerifyScreenDump(buf, 'Test_popup_textprop_02', {}) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 call term_sendkeys(buf, "zzIawe\<Esc>") |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 call VerifyScreenDump(buf, 'Test_popup_textprop_03', {}) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 call term_sendkeys(buf, "0dw") |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 call VerifyScreenDump(buf, 'Test_popup_textprop_04', {}) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 call term_sendkeys(buf, "Oinserted\<Esc>") |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 call VerifyScreenDump(buf, 'Test_popup_textprop_05', {}) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
44 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
45 call term_sendkeys(buf, "k2dd") |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 call VerifyScreenDump(buf, 'Test_popup_textprop_06', {}) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
47 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
48 " clean up |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
49 call StopVimInTerminal(buf) |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
50 call delete('XtestTextpropPopup') |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
51 endfunc |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
52 |
17875
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
53 func Test_textprop_popup_corners() |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
54 let lines =<< trim END |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
55 call setline(1, range(1, 100)) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
56 call setline(50, 'now working with some longer text here') |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
57 50 |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
58 normal zz |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
59 set scrolloff=0 |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
60 call prop_type_add('popupMarker', #{highlight: 'DiffAdd'}) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
61 call prop_add(50, 23, #{ |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
62 \ length: 6, |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
63 \ type: 'popupMarker', |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
64 \ }) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
65 let winid = popup_create('bottom left', #{ |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
66 \ pos: 'botleft', |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
67 \ textprop: 'popupMarker', |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
68 \ padding: [0,1,0,1], |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
69 \ }) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
70 let winid = popup_create('bottom right', #{ |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
71 \ pos: 'botright', |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
72 \ textprop: 'popupMarker', |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
73 \ border: [], |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
74 \ padding: [0,1,0,1], |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
75 \ }) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
76 let winid = popup_create('top left', #{ |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
77 \ pos: 'topleft', |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
78 \ textprop: 'popupMarker', |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
79 \ border: [], |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
80 \ padding: [0,1,0,1], |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
81 \ }) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
82 let winid = popup_create('top right', #{ |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
83 \ pos: 'topright', |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
84 \ textprop: 'popupMarker', |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
85 \ padding: [0,1,0,1], |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
86 \ }) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
87 END |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
88 call writefile(lines, 'XtestTextpropPopupCorners') |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
89 let buf = RunVimInTerminal('-S XtestTextpropPopupCorners', #{rows: 12}) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
90 call VerifyScreenDump(buf, 'Test_popup_textprop_corn_1', {}) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
91 |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
92 call term_sendkeys(buf, "0dw") |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
93 call VerifyScreenDump(buf, 'Test_popup_textprop_corn_2', {}) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
94 |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
95 call term_sendkeys(buf, "46Goextra\<Esc>") |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
96 call VerifyScreenDump(buf, 'Test_popup_textprop_corn_3', {}) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
97 |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
98 call term_sendkeys(buf, "u") |
17877
642832e45388
patch 8.1.1935: test for text property popup window is flaky
Bram Moolenaar <Bram@vim.org>
parents:
17875
diff
changeset
|
99 call term_sendkeys(buf, ":\<CR>") |
17875
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
100 call VerifyScreenDump(buf, 'Test_popup_textprop_corn_4', {}) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
101 |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
102 " clean up |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
103 call StopVimInTerminal(buf) |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
104 call delete('XtestTextpropPopupCorners') |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
105 endfunc |
f13a5c48320b
patch 8.1.1934: not enough tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
17865
diff
changeset
|
106 |
17865
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
107 |
eaf8b21d80e7
patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
108 " vim: shiftwidth=2 sts=2 |