summaryrefslogtreecommitdiff
path: root/src/testdir/test_terminal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-03 14:53:10 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-03 14:53:10 +0100
commitaa5df7e3127dff6b7336df0903f5c569a40eb174 (patch)
tree491988c562057debdd52dc8198958e4099fd9452 /src/testdir/test_terminal.vim
parent01a6c21691631ee55744a1799a9725e5d6521cf4 (diff)
downloadvim-git-aa5df7e3127dff6b7336df0903f5c569a40eb174.tar.gz
patch 8.1.0870: Vim doesn't use the new ConPTY support in Windows 10v8.1.0870
Problem: Vim doesn't use the new ConPTY support in Windows 10. Solution: Use ConPTY support, if available. (Nobuhiro Takasaki, closes #3794)
Diffstat (limited to 'src/testdir/test_terminal.vim')
-rw-r--r--src/testdir/test_terminal.vim30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index 698da0498..8eb43a0cc 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -39,8 +39,11 @@ func Test_terminal_basic()
call assert_match('^/dev/', job_info(g:job).tty_out)
call assert_match('^/dev/', term_gettty(''))
else
- call assert_match('^\\\\.\\pipe\\', job_info(g:job).tty_out)
- call assert_match('^\\\\.\\pipe\\', term_gettty(''))
+ " ConPTY works on anonymous pipe.
+ if !has('conpty')
+ call assert_match('^\\\\.\\pipe\\', job_info(g:job).tty_out)
+ call assert_match('^\\\\.\\pipe\\', term_gettty(''))
+ endif
endif
call assert_equal('t', mode())
call assert_equal('yes', b:done)
@@ -129,7 +132,12 @@ endfunc
func Get_cat_123_cmd()
if has('win32')
- return 'cmd /c "cls && color 2 && echo 123"'
+ if !has('conpty')
+ return 'cmd /c "cls && color 2 && echo 123"'
+ else
+ " When clearing twice, extra sequence is not output.
+ return 'cmd /c "cls && cls && color 2 && echo 123"'
+ endif
else
call writefile(["\<Esc>[32m123"], 'Xtext')
return "cat Xtext"
@@ -143,8 +151,8 @@ func Test_terminal_nasty_cb()
call WaitForAssert({-> assert_equal("dead", job_status(g:job))})
call WaitForAssert({-> assert_equal(0, g:buf)})
- unlet g:buf
unlet g:job
+ unlet g:buf
call delete('Xtext')
endfunc
@@ -563,6 +571,9 @@ func Test_terminal_noblock()
" The shell or something else has a problem dealing with more than 1000
" characters at the same time.
let len = 1000
+ " NPFS is used in Windows, nonblocking mode does not work properly.
+ elseif has('win32')
+ let len = 1
else
let len = 5000
endif
@@ -693,8 +704,11 @@ func Test_terminal_redir_file()
let cmd = Get_cat_123_cmd()
let buf = term_start(cmd, {'out_io': 'file', 'out_name': 'Xfile'})
call term_wait(buf)
- call WaitForAssert({-> assert_notequal(0, len(readfile("Xfile")))})
- call assert_match('123', readfile('Xfile')[0])
+ " ConPTY may precede escape sequence. There are things that are not so.
+ if !has('conpty')
+ call WaitForAssert({-> assert_notequal(0, len(readfile("Xfile")))})
+ call assert_match('123', readfile('Xfile')[0])
+ endif
let g:job = term_getjob(buf)
call WaitForAssert({-> assert_equal("dead", job_status(g:job))})
call delete('Xfile')
@@ -1661,6 +1675,10 @@ func Test_terminal_hidden_and_close()
endfunc
func Test_terminal_does_not_truncate_last_newlines()
+ " This test does not pass through ConPTY.
+ if has('conpty')
+ return
+ endif
let contents = [
\ [ 'One', '', 'X' ],
\ [ 'Two', '', '' ],