Mercurial > vim
comparison src/testdir/test_messages.vim @ 20625:116c7bd5e980 v8.2.0866
patch 8.2.0866: not enough tests for buffer writing
Commit: https://github.com/vim/vim/commit/494e9069cb32620f7688a7cb128a3feff827639e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 31 21:28:02 2020 +0200
patch 8.2.0866: not enough tests for buffer writing
Problem: Not enough tests for buffer writing.
Solution: Add more tests. Use CheckRunVimInTerminal in more places.
(Yegappan Lakshmanan, closes #6167)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 31 May 2020 21:30:03 +0200 |
parents | c2570baa2e4c |
children | 8bce783af0cb |
comparison
equal
deleted
inserted
replaced
20624:f782c48d548a | 20625:116c7bd5e980 |
---|---|
1 " Tests for :messages, :echomsg, :echoerr | 1 " Tests for :messages, :echomsg, :echoerr |
2 | 2 |
3 source check.vim | |
3 source shared.vim | 4 source shared.vim |
4 source term_util.vim | 5 source term_util.vim |
5 source view_util.vim | 6 source view_util.vim |
6 | 7 |
7 func Test_messages() | 8 func Test_messages() |
170 set ruler& showcmd& | 171 set ruler& showcmd& |
171 endfunc | 172 endfunc |
172 | 173 |
173 " Test more-prompt (see :help more-prompt). | 174 " Test more-prompt (see :help more-prompt). |
174 func Test_message_more() | 175 func Test_message_more() |
175 if !CanRunVimInTerminal() | 176 CheckRunVimInTerminal |
176 throw 'Skipped: cannot run vim in terminal' | |
177 endif | |
178 let buf = RunVimInTerminal('', {'rows': 6}) | 177 let buf = RunVimInTerminal('', {'rows': 6}) |
179 call term_sendkeys(buf, ":call setline(1, range(1, 100))\n") | 178 call term_sendkeys(buf, ":call setline(1, range(1, 100))\n") |
180 | 179 |
181 call term_sendkeys(buf, ":%p#\n") | 180 call term_sendkeys(buf, ":%p#\n") |
182 call WaitForAssert({-> assert_equal(' 5 5', term_getline(buf, 5))}) | 181 call WaitForAssert({-> assert_equal(' 5 5', term_getline(buf, 5))}) |
263 | 262 |
264 call StopVimInTerminal(buf) | 263 call StopVimInTerminal(buf) |
265 endfunc | 264 endfunc |
266 | 265 |
267 func Test_ask_yesno() | 266 func Test_ask_yesno() |
268 if !CanRunVimInTerminal() | 267 CheckRunVimInTerminal |
269 throw 'Skipped: cannot run vim in terminal' | |
270 endif | |
271 let buf = RunVimInTerminal('', {'rows': 6}) | 268 let buf = RunVimInTerminal('', {'rows': 6}) |
272 call term_sendkeys(buf, ":call setline(1, range(1, 2))\n") | 269 call term_sendkeys(buf, ":call setline(1, range(1, 2))\n") |
273 | 270 |
274 call term_sendkeys(buf, ":2,1s/^/n/\n") | 271 call term_sendkeys(buf, ":2,1s/^/n/\n") |
275 call WaitForAssert({-> assert_equal('Backwards range given, OK to swap (y/n)?', term_getline(buf, 6))}) | 272 call WaitForAssert({-> assert_equal('Backwards range given, OK to swap (y/n)?', term_getline(buf, 6))}) |