diff src/testdir/test_terminal.vim @ 14449:5faab0545f3c v8.1.0238

patch 8.1.0238: 'buftype' is cleared when using ":term ++hidden cat" commit https://github.com/vim/vim/commit/7da1fb5532890d9c15cdb5b9bec158f9f9c105a7 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 4 16:54:11 2018 +0200 patch 8.1.0238: 'buftype' is cleared when using ":term ++hidden cat" Problem: 'buftype' is cleared when using ":term ++hidden cat". (Marcin Szamotulski) Solution: Set the "options initialized" flag earlier. (closes #3278)
author Christian Brabandt <cb@256bit.org>
date Sat, 04 Aug 2018 17:00:05 +0200
parents 83b870d9ac4b
children ecf6c05d8ac3
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -1605,3 +1605,19 @@ func Test_zz2_terminal_guioptions_bang()
   set guioptions&
   call delete(filename)
 endfunc
+
+func Test_terminal_hidden()
+  if !has('unix')
+    return
+  endif
+  term ++hidden cat
+  let bnr = bufnr('$')
+  call assert_equal('terminal', getbufvar(bnr, '&buftype'))
+  exe 'sbuf ' . bnr
+  call assert_equal('terminal', &buftype)
+  call term_sendkeys(bnr, "asdf\<CR>")
+  call WaitForAssert({-> assert_match('asdf', term_getline(bnr, 2))})
+  call term_sendkeys(bnr, "\<C-D>")
+  call WaitForAssert({-> assert_equal('finished', term_getstatus(bnr))})
+  bwipe!
+endfunc