Mercurial > vim
diff 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 |
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -271,6 +271,27 @@ func Test_terminal_scroll() call delete('Xtext') endfunc +func Test_terminal_scrollback() + let buf = Run_shell_in_terminal({}) + set terminalscroll=100 + call writefile(range(150), 'Xtext') + if has('win32') + call term_sendkeys(buf, "type Xtext\<CR>") + else + call term_sendkeys(buf, "cat Xtext\<CR>") + endif + let rows = term_getsize(buf)[0] + call WaitFor({-> term_getline(buf, rows - 1) =~ '149'}) + let lines = line('$') + call assert_true(lines <= 100) + call assert_true(lines > 90) + + call Stop_shell_in_terminal(buf) + call term_wait(buf) + exe buf . 'bwipe' + set terminalscroll& +endfunc + func Test_terminal_size() let cmd = Get_cat_123_cmd() @@ -298,6 +319,7 @@ func Test_terminal_size() call assert_equal([7, 30], term_getsize('')) bwipe! + call assert_fails("call term_setsize('', 7, 30)", "E955:") call term_start(cmd, {'term_rows': 6, 'term_cols': 36}) let size = term_getsize('')