Mercurial > vim
comparison src/testdir/test_cmdwin.vim @ 30164:f7a2de8a4ddc v9.0.0418
patch 9.0.0418: manually deleting temp test files
Commit: https://github.com/vim/vim/commit/45bbaef0382c5468d9fac511775bd99ea7bf5b84
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 8 16:39:22 2022 +0100
patch 9.0.0418: manually deleting temp test files
Problem: Manually deleting temp test files.
Solution: Use the 'D' flag of writefile() and mkdir().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 08 Sep 2022 17:45:03 +0200 |
parents | 8629106c4982 |
children | 6b541aaaf39e |
comparison
equal
deleted
inserted
replaced
30163:ac28d70ac476 | 30164:f7a2de8a4ddc |
---|---|
68 let lines =<< trim [SCRIPT] | 68 let lines =<< trim [SCRIPT] |
69 augroup vimHints | au! | augroup END | 69 augroup vimHints | au! | augroup END |
70 call setline(1, range(30)) | 70 call setline(1, range(30)) |
71 2split | 71 2split |
72 [SCRIPT] | 72 [SCRIPT] |
73 call writefile(lines, 'XTest_restore') | 73 call writefile(lines, 'XTest_restore', 'D') |
74 | 74 |
75 let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12}) | 75 let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12}) |
76 call TermWait(buf, 50) | 76 call TermWait(buf, 50) |
77 call term_sendkeys(buf, "q:") | 77 call term_sendkeys(buf, "q:") |
78 call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {}) | 78 call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {}) |
88 call term_sendkeys(buf, ":q\<CR>") | 88 call term_sendkeys(buf, ":q\<CR>") |
89 call VerifyScreenDump(buf, 'Test_cmdwin_restore_3', {}) | 89 call VerifyScreenDump(buf, 'Test_cmdwin_restore_3', {}) |
90 | 90 |
91 " clean up | 91 " clean up |
92 call StopVimInTerminal(buf) | 92 call StopVimInTerminal(buf) |
93 call delete('XTest_restore') | |
94 endfunc | 93 endfunc |
95 | 94 |
96 func Test_cmdwin_no_terminal() | 95 func Test_cmdwin_no_terminal() |
97 CheckFeature terminal | 96 CheckFeature terminal |
98 CheckNotMSWindows | 97 CheckNotMSWindows |
184 " aborting the :smile output caused the cmdline window to use the current | 183 " aborting the :smile output caused the cmdline window to use the current |
185 " buffer. | 184 " buffer. |
186 let lines =<< trim [SCRIPT] | 185 let lines =<< trim [SCRIPT] |
187 au WinNew * smile | 186 au WinNew * smile |
188 [SCRIPT] | 187 [SCRIPT] |
189 call writefile(lines, 'XTest_cmdwin') | 188 call writefile(lines, 'XTest_cmdwin', 'D') |
190 | 189 |
191 let buf = RunVimInTerminal('-S XTest_cmdwin', {'rows': 18}) | 190 let buf = RunVimInTerminal('-S XTest_cmdwin', {'rows': 18}) |
192 " open cmdwin | 191 " open cmdwin |
193 call term_sendkeys(buf, "q:") | 192 call term_sendkeys(buf, "q:") |
194 call WaitForAssert({-> assert_match('-- More --', term_getline(buf, 18))}) | 193 call WaitForAssert({-> assert_match('-- More --', term_getline(buf, 18))}) |
199 call term_sendkeys(buf, "aecho 'done'\<CR>") | 198 call term_sendkeys(buf, "aecho 'done'\<CR>") |
200 call VerifyScreenDump(buf, 'Test_cmdwin_interrupted', {}) | 199 call VerifyScreenDump(buf, 'Test_cmdwin_interrupted', {}) |
201 | 200 |
202 " clean up | 201 " clean up |
203 call StopVimInTerminal(buf) | 202 call StopVimInTerminal(buf) |
204 call delete('XTest_cmdwin') | |
205 endfunc | 203 endfunc |
206 | 204 |
207 " Test for recursively getting multiple command line inputs | 205 " Test for recursively getting multiple command line inputs |
208 func Test_cmdwin_multi_input() | 206 func Test_cmdwin_multi_input() |
209 call feedkeys(":\<C-R>=input('P: ')\<CR>\"cyan\<CR>\<CR>", 'xt') | 207 call feedkeys(":\<C-R>=input('P: ')\<CR>\"cyan\<CR>\<CR>", 'xt') |