Mercurial > vim
comparison src/testdir/test_popupwin_textprop.vim @ 30592:457ea0570b6f v9.0.0631
patch 9.0.0631: too many delete() calls in tests
Commit: https://github.com/vim/vim/commit/145d1fd91041bd2a22a11eef0357702e420796e2
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 30 21:57:11 2022 +0100
patch 9.0.0631: too many delete() calls in tests
Problem: Too many delete() calls in tests.
Solution: Use deferred delete where possible.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 30 Sep 2022 23:00:10 +0200 |
parents | 49b78d6465e5 |
children | dbec60b8c253 |
comparison
equal
deleted
inserted
replaced
30591:38ef10db4a4e | 30592:457ea0570b6f |
---|---|
26 \ border: [], | 26 \ border: [], |
27 \ padding: [0,1,0,1], | 27 \ padding: [0,1,0,1], |
28 \ close: 'click', | 28 \ close: 'click', |
29 \ }) | 29 \ }) |
30 END | 30 END |
31 call writefile(lines, 'XtestTextpropPopup') | 31 call writefile(lines, 'XtestTextpropPopup', 'D') |
32 let buf = RunVimInTerminal('-S XtestTextpropPopup', #{rows: 10}) | 32 let buf = RunVimInTerminal('-S XtestTextpropPopup', #{rows: 10}) |
33 call VerifyScreenDump(buf, 'Test_popup_textprop_01', {}) | 33 call VerifyScreenDump(buf, 'Test_popup_textprop_01', {}) |
34 | 34 |
35 call term_sendkeys(buf, "zt") | 35 call term_sendkeys(buf, "zt") |
36 call VerifyScreenDump(buf, 'Test_popup_textprop_02', {}) | 36 call VerifyScreenDump(buf, 'Test_popup_textprop_02', {}) |
50 call term_sendkeys(buf, "4\<C-E>") | 50 call term_sendkeys(buf, "4\<C-E>") |
51 call VerifyScreenDump(buf, 'Test_popup_textprop_07', {}) | 51 call VerifyScreenDump(buf, 'Test_popup_textprop_07', {}) |
52 | 52 |
53 " clean up | 53 " clean up |
54 call StopVimInTerminal(buf) | 54 call StopVimInTerminal(buf) |
55 call delete('XtestTextpropPopup') | |
56 endfunc | 55 endfunc |
57 | 56 |
58 func Test_textprop_popup_corners() | 57 func Test_textprop_popup_corners() |
59 let lines =<< trim END | 58 let lines =<< trim END |
60 call setline(1, range(1, 100)) | 59 call setline(1, range(1, 100)) |
89 \ pos: 'topright', | 88 \ pos: 'topright', |
90 \ textprop: 'popupMarker', | 89 \ textprop: 'popupMarker', |
91 \ padding: [0,1,0,1], | 90 \ padding: [0,1,0,1], |
92 \ }) | 91 \ }) |
93 END | 92 END |
94 call writefile(lines, 'XtestTextpropPopupCorners') | 93 call writefile(lines, 'XtestTextpropPopupCorners', 'D') |
95 let buf = RunVimInTerminal('-S XtestTextpropPopupCorners', #{rows: 12}) | 94 let buf = RunVimInTerminal('-S XtestTextpropPopupCorners', #{rows: 12}) |
96 call VerifyScreenDump(buf, 'Test_popup_textprop_corn_1', {}) | 95 call VerifyScreenDump(buf, 'Test_popup_textprop_corn_1', {}) |
97 | 96 |
98 call term_sendkeys(buf, "0dw") | 97 call term_sendkeys(buf, "0dw") |
99 call VerifyScreenDump(buf, 'Test_popup_textprop_corn_2', {}) | 98 call VerifyScreenDump(buf, 'Test_popup_textprop_corn_2', {}) |
111 call term_sendkeys(buf, ":only!\<CR>") | 110 call term_sendkeys(buf, ":only!\<CR>") |
112 call VerifyScreenDump(buf, 'Test_popup_textprop_corn_6', {}) | 111 call VerifyScreenDump(buf, 'Test_popup_textprop_corn_6', {}) |
113 | 112 |
114 " clean up | 113 " clean up |
115 call StopVimInTerminal(buf) | 114 call StopVimInTerminal(buf) |
116 call delete('XtestTextpropPopupCorners') | |
117 endfunc | 115 endfunc |
118 | 116 |
119 func Test_textprop_popup_offsets() | 117 func Test_textprop_popup_offsets() |
120 let lines =<< trim END | 118 let lines =<< trim END |
121 call setline(1, range(1, 100)) | 119 call setline(1, range(1, 100)) |
157 \ col: -2, | 155 \ col: -2, |
158 \ textprop: 'popupMarker', | 156 \ textprop: 'popupMarker', |
159 \ padding: [0,1,0,1], | 157 \ padding: [0,1,0,1], |
160 \ }) | 158 \ }) |
161 END | 159 END |
162 call writefile(lines, 'XtestTextpropPopupOffset') | 160 call writefile(lines, 'XtestTextpropPopupOffset', 'D') |
163 let buf = RunVimInTerminal('-S XtestTextpropPopupOffset', #{rows: 12}) | 161 let buf = RunVimInTerminal('-S XtestTextpropPopupOffset', #{rows: 12}) |
164 call VerifyScreenDump(buf, 'Test_popup_textprop_off_1', {}) | 162 call VerifyScreenDump(buf, 'Test_popup_textprop_off_1', {}) |
165 | 163 |
166 " test that removing the text property closes the popups | 164 " test that removing the text property closes the popups |
167 call term_sendkeys(buf, ":call prop_clear(50)\<CR>") | 165 call term_sendkeys(buf, ":call prop_clear(50)\<CR>") |
168 call VerifyScreenDump(buf, 'Test_popup_textprop_off_2', {}) | 166 call VerifyScreenDump(buf, 'Test_popup_textprop_off_2', {}) |
169 | 167 |
170 " clean up | 168 " clean up |
171 call StopVimInTerminal(buf) | 169 call StopVimInTerminal(buf) |
172 call delete('XtestTextpropPopupOffset') | |
173 endfunc | 170 endfunc |
174 | 171 |
175 | 172 |
176 " vim: shiftwidth=2 sts=2 | 173 " vim: shiftwidth=2 sts=2 |