diff src/testdir/test_terminal.vim @ 13829:044337cbf854 v8.0.1786

patch 8.0.1786: no test for 'termwinkey' commit https://github.com/vim/vim/commit/b2ac14c0b5e23f8ab97c5c784bcd83e13ba8ded3 Author: Bram Moolenaar <Bram@vim.org> Date: Tue May 1 18:47:59 2018 +0200 patch 8.0.1786: no test for 'termwinkey' Problem: No test for 'termwinkey'. Solution: Add a test. Make feedkeys() handle terminal_loop() returning before characters are consumed.
author Christian Brabandt <cb@256bit.org>
date Tue, 01 May 2018 19:00:07 +0200
parents 9b0e4976dac6
children 8e583c52eb44
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -1471,3 +1471,19 @@ func Test_terminal_termwinsize_mininmum(
 
   set termwinsize=
 endfunc
+
+func Test_terminal_termwinkey()
+  call assert_equal(1, winnr('$'))
+  let thiswin = win_getid()
+
+  let buf = Run_shell_in_terminal({})
+  let termwin = bufwinid(buf)
+  set termwinkey=<C-L>
+  call feedkeys("\<C-L>w", 'tx')
+  call assert_equal(thiswin, win_getid())
+  call feedkeys("\<C-W>w", 'tx')
+
+  let job = term_getjob(buf)
+  call feedkeys("\<C-L>\<C-C>", 'tx')
+  call WaitForAssert({-> assert_equal("dead", job_status(job))})
+endfunc