comparison src/testdir/test_terminal.vim @ 21897:e0af4660dfc7 v8.2.1498

patch 8.2.1498: on slow systems tests can be flaky Commit: https://github.com/vim/vim/commit/733d259a83bfdd3e1670cc1665e1bd56501799df Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 20 18:59:06 2020 +0200 patch 8.2.1498: on slow systems tests can be flaky Problem: On slow systems tests can be flaky. Solution: Use TermWait() instead of term-wait(). (Yegappan Lakshmanan, closes #6756)
author Bram Moolenaar <Bram@vim.org>
date Thu, 20 Aug 2020 19:00:03 +0200
parents 08940efa6b4e
children ff21e2962490
comparison
equal deleted inserted replaced
21896:4f7b50471a6a 21897:e0af4660dfc7
262 " This creates a terminal, displays a double-wide character and makes the 262 " This creates a terminal, displays a double-wide character and makes the
263 " window one column wide. This used to cause a crash. 263 " window one column wide. This used to cause a crash.
264 let width = &columns 264 let width = &columns
265 botright vert term 265 botright vert term
266 let buf = bufnr('$') 266 let buf = bufnr('$')
267 call term_wait(buf, 100) 267 call TermWait(buf, 100)
268 exe "set columns=" .. (width / 2) 268 exe "set columns=" .. (width / 2)
269 redraw 269 redraw
270 call term_sendkeys(buf, "キ") 270 call term_sendkeys(buf, "キ")
271 call term_wait(buf, 10) 271 call TermWait(buf, 10)
272 exe "set columns=" .. width 272 exe "set columns=" .. width
273 exe buf . 'bwipe!' 273 exe buf . 'bwipe!'
274 endfunc 274 endfunc
275 275
276 func Test_terminal_scroll() 276 func Test_terminal_scroll()
1219 " Tests for failures in the term_dumpwrite() function 1219 " Tests for failures in the term_dumpwrite() function
1220 func Test_terminal_dumpwrite_errors() 1220 func Test_terminal_dumpwrite_errors()
1221 CheckRunVimInTerminal 1221 CheckRunVimInTerminal
1222 call assert_fails("call term_dumpwrite({}, 'Xtest.dump')", 'E728:') 1222 call assert_fails("call term_dumpwrite({}, 'Xtest.dump')", 'E728:')
1223 let buf = RunVimInTerminal('', {}) 1223 let buf = RunVimInTerminal('', {})
1224 call term_wait(buf) 1224 call TermWait(buf)
1225 call assert_fails("call term_dumpwrite(buf, 'Xtest.dump', '')", 'E715:') 1225 call assert_fails("call term_dumpwrite(buf, 'Xtest.dump', '')", 'E715:')
1226 call assert_fails("call term_dumpwrite(buf, [])", 'E730:') 1226 call assert_fails("call term_dumpwrite(buf, [])", 'E730:')
1227 call writefile([], 'Xtest.dump') 1227 call writefile([], 'Xtest.dump')
1228 call assert_fails("call term_dumpwrite(buf, 'Xtest.dump')", 'E953:') 1228 call assert_fails("call term_dumpwrite(buf, 'Xtest.dump')", 'E953:')
1229 call delete('Xtest.dump') 1229 call delete('Xtest.dump')
1230 call assert_fails("call term_dumpwrite(buf, '')", 'E482:') 1230 call assert_fails("call term_dumpwrite(buf, '')", 'E482:')
1231 call assert_fails("call term_dumpwrite(buf, test_null_string())", 'E482:') 1231 call assert_fails("call term_dumpwrite(buf, test_null_string())", 'E482:')
1232 call test_garbagecollect_now() 1232 call test_garbagecollect_now()
1233 call StopVimInTerminal(buf) 1233 call StopVimInTerminal(buf)
1234 call term_wait(buf) 1234 call TermWait(buf)
1235 call assert_fails("call term_dumpwrite(buf, 'Xtest.dump')", 'E958:') 1235 call assert_fails("call term_dumpwrite(buf, 'Xtest.dump')", 'E958:')
1236 call assert_fails('call term_sendkeys([], ":q\<CR>")', 'E745:') 1236 call assert_fails('call term_sendkeys([], ":q\<CR>")', 'E745:')
1237 call assert_equal(0, term_sendkeys(buf, ":q\<CR>")) 1237 call assert_equal(0, term_sendkeys(buf, ":q\<CR>"))
1238 endfunc 1238 endfunc
1239 1239