comparison src/testdir/test_terminal.vim @ 13684:1651a4c5c27a v8.0.1714

patch 8.0.1714: term_setsize() does not give an error in a normal buffer commit https://github.com/vim/vim/commit/6e72cd0d7267b9545ef966a53e62706914a96042 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 14 21:31:35 2018 +0200 patch 8.0.1714: term_setsize() does not give an error in a normal buffer Problem: Term_setsize() does not give an error in a normal buffer. Solution: Add an error message.
author Christian Brabandt <cb@256bit.org>
date Sat, 14 Apr 2018 21:45:07 +0200
parents 39fcaaa973db
children f07e48d6650b
comparison
equal deleted inserted replaced
13683:71eeadf55d78 13684:1651a4c5c27a
269 269
270 exe buf . 'bwipe' 270 exe buf . 'bwipe'
271 call delete('Xtext') 271 call delete('Xtext')
272 endfunc 272 endfunc
273 273
274 func Test_terminal_scrollback()
275 let buf = Run_shell_in_terminal({})
276 set terminalscroll=100
277 call writefile(range(150), 'Xtext')
278 if has('win32')
279 call term_sendkeys(buf, "type Xtext\<CR>")
280 else
281 call term_sendkeys(buf, "cat Xtext\<CR>")
282 endif
283 let rows = term_getsize(buf)[0]
284 call WaitFor({-> term_getline(buf, rows - 1) =~ '149'})
285 let lines = line('$')
286 call assert_true(lines <= 100)
287 call assert_true(lines > 90)
288
289 call Stop_shell_in_terminal(buf)
290 call term_wait(buf)
291 exe buf . 'bwipe'
292 set terminalscroll&
293 endfunc
294
274 func Test_terminal_size() 295 func Test_terminal_size()
275 let cmd = Get_cat_123_cmd() 296 let cmd = Get_cat_123_cmd()
276 297
277 exe 'terminal ++rows=5 ' . cmd 298 exe 'terminal ++rows=5 ' . cmd
278 let size = term_getsize('') 299 let size = term_getsize('')
296 317
297 call term_setsize('', 7, 30) 318 call term_setsize('', 7, 30)
298 call assert_equal([7, 30], term_getsize('')) 319 call assert_equal([7, 30], term_getsize(''))
299 320
300 bwipe! 321 bwipe!
322 call assert_fails("call term_setsize('', 7, 30)", "E955:")
301 323
302 call term_start(cmd, {'term_rows': 6, 'term_cols': 36}) 324 call term_start(cmd, {'term_rows': 6, 'term_cols': 36})
303 let size = term_getsize('') 325 let size = term_getsize('')
304 bwipe! 326 bwipe!
305 call assert_equal([6, 36], size) 327 call assert_equal([6, 36], size)