summaryrefslogtreecommitdiff
path: root/src/testdir/test_terminal2.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_terminal2.vim')
-rw-r--r--src/testdir/test_terminal2.vim31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/testdir/test_terminal2.vim b/src/testdir/test_terminal2.vim
index 93ace42d8..f9f221b5c 100644
--- a/src/testdir/test_terminal2.vim
+++ b/src/testdir/test_terminal2.vim
@@ -109,6 +109,27 @@ func Test_terminal_termwinsize_minimum()
set termwinsize=
endfunc
+func Test_terminal_termwinsize_overruled()
+ let cmd = GetDummyCmd()
+ set termwinsize=5x43
+ let buf = term_start(cmd, #{term_rows: 7, term_cols: 50})
+ call TermWait(buf)
+ call assert_equal([7, 50], term_getsize(buf))
+ exe "bwipe! " .. buf
+
+ let buf = term_start(cmd, #{term_cols: 50})
+ call TermWait(buf)
+ call assert_equal([5, 50], term_getsize(buf))
+ exe "bwipe! " .. buf
+
+ let buf = term_start(cmd, #{term_rows: 7})
+ call TermWait(buf)
+ call assert_equal([7, 43], term_getsize(buf))
+ exe "bwipe! " .. buf
+
+ set termwinsize=
+endfunc
+
func Test_terminal_termwinkey()
" make three tabpages, terminal in the middle
0tabnew
@@ -397,13 +418,17 @@ func Test_terminal_does_not_truncate_last_newlines()
call delete('Xfile')
endfunc
-func Test_terminal_no_job()
+func GetDummyCmd()
if has('win32')
- let cmd = 'cmd /c ""'
+ return 'cmd /c ""'
else
CheckExecutable false
- let cmd = 'false'
+ return 'false'
endif
+endfunc
+
+func Test_terminal_no_job()
+ let cmd = GetDummyCmd()
let term = term_start(cmd, {'term_finish': 'close'})
call WaitForAssert({-> assert_equal(v:null, term_getjob(term)) })
endfunc