diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-03-30 19:32:53 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-03-30 19:32:53 +0200 |
commit | ca68ae13114619df3e4c195b41ad0575516f5ff6 (patch) | |
tree | 9022b7f5f1c8bb1ab22660530244414e9b6cdd99 /src/testdir/test_terminal.vim | |
parent | 7d333a900d260b8e8caa0fb159c85023fc8795bd (diff) | |
download | vim-git-ca68ae13114619df3e4c195b41ad0575516f5ff6.tar.gz |
patch 8.2.0482: channel and sandbox code not sufficiently testedv8.2.0482
Problem: Channel and sandbox code not sufficiently tested.
Solution: Add more tests. (Yegappan Lakshmanan, closes #5855)
Diffstat (limited to 'src/testdir/test_terminal.vim')
-rw-r--r-- | src/testdir/test_terminal.vim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 40749c4af..9e20a7741 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -1001,6 +1001,28 @@ func Test_terminal_term_start_empty_command() call assert_fails(cmd, 'E474') let cmd = "call term_start(0, {'curwin' : 1, 'term_finish' : 'close'})" call assert_fails(cmd, 'E474') + let cmd = "call term_start('', {'term_name' : []})" + call assert_fails(cmd, 'E475') + let cmd = "call term_start('', {'term_finish' : 'axby'})" + call assert_fails(cmd, 'E475') + let cmd = "call term_start('', {'eof_chars' : []})" + call assert_fails(cmd, 'E475:') + let cmd = "call term_start('', {'term_kill' : []})" + call assert_fails(cmd, 'E475:') + let cmd = "call term_start('', {'tty_type' : []})" + call assert_fails(cmd, 'E475:') + let cmd = "call term_start('', {'tty_type' : 'abc'})" + call assert_fails(cmd, 'E475:') + let cmd = "call term_start('', {'term_highlight' : []})" + call assert_fails(cmd, 'E475:') + if has('gui') + let cmd = "call term_start('', {'ansi_colors' : 'abc'})" + call assert_fails(cmd, 'E475:') + let cmd = "call term_start('', {'ansi_colors' : [[]]})" + call assert_fails(cmd, 'E730:') + let cmd = "call term_start('', {'ansi_colors' : repeat(['blue'], 18)})" + call assert_fails(cmd, 'E475:') + endif endfunc func Test_terminal_response_to_control_sequence() @@ -1285,6 +1307,7 @@ func Test_terminal_dumpdiff_options() call assert_equal(1, winnr('$')) call term_dumpdiff('dumps/Test_popup_command_01.dump', 'dumps/Test_popup_command_02.dump', {'curwin': 1}) call assert_equal(1, winnr('$')) + call assert_fails("call term_dumpdiff('dumps/Test_popup_command_01.dump', 'dumps/Test_popup_command_02.dump', {'bufnr': -1})", 'E475:') bwipe set laststatus& @@ -1486,6 +1509,8 @@ func Test_terminal_api_call() call assert_equal(['hello', 123], g:called_arg2) call StopVimInTerminal(buf) + call assert_fails("call term_start('ls', {'term_api' : []})", 'E475:') + unlet! g:called_bufnum2 unlet! g:called_arg2 @@ -2552,3 +2577,5 @@ func Test_term_nasty_callback() exe g:buf0 .. 'bwipe!' set hidden& endfunc + +" vim: shiftwidth=2 sts=2 expandtab |