diff src/testdir/test_terminal.vim @ 12060:a879814b8a37 v8.0.0910

patch 8.0.0910: cannot create a terminal in the current window commit https://github.com/vim/vim/commit/da43b61dddcf81439a6f1716956a4e8d9046e68f Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 11 22:27:50 2017 +0200 patch 8.0.0910: cannot create a terminal in the current window Problem: Cannot create a terminal in the current window. Solution: Add option "curwin" and ++curwin.
author Christian Brabandt <cb@256bit.org>
date Fri, 11 Aug 2017 22:30:06 +0200
parents 0498547dace0
children 191ccece2f5d
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -283,6 +283,38 @@ func Test_terminal_size()
   let size = term_getsize('')
   bwipe!
   call assert_equal([7, 27], size)
+endfunc
+
+func Test_terminal_curwin()
+  let cmd = Get_cat_123_cmd()
+  call assert_equal(1, winnr('$'))
+
+  split dummy
+  exe 'terminal ++curwin ' . cmd
+  call assert_equal(2, winnr('$'))
+  bwipe!
+
+  split dummy
+  call term_start(cmd, {'curwin': 1})
+  call assert_equal(2, winnr('$'))
+  bwipe!
+
+  split dummy
+  call setline(1, 'change')
+  call assert_fails('terminal ++curwin ' . cmd, 'E37:')
+  call assert_equal(2, winnr('$'))
+  exe 'terminal! ++curwin ' . cmd
+  call assert_equal(2, winnr('$'))
+  bwipe!
+
+  split dummy
+  call setline(1, 'change')
+  call assert_fails("call term_start(cmd, {'curwin': 1})", 'E37:')
+  call assert_equal(2, winnr('$'))
+  bwipe!
+
+  split dummy
+  bwipe!
 
 endfunc