summaryrefslogtreecommitdiff
path: root/src/testdir/test_terminal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-26 15:59:55 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-26 15:59:55 +0200
commit99fa721944dda9d07c53c907c33466728df5c271 (patch)
tree7ead4c06b56e21eb208ea1b9673cd463ba13f3c0 /src/testdir/test_terminal.vim
parente297802d6ddbebbf36f9a2d01127c034fab88b3b (diff)
downloadvim-git-99fa721944dda9d07c53c907c33466728df5c271.tar.gz
patch 8.2.0644: insufficient testing for invalid function argumentsv8.2.0644
Problem: Insufficient testing for invalid function arguments. Solution: Add more tests. (Yegappan Lakshmanan, closes #5988)
Diffstat (limited to 'src/testdir/test_terminal.vim')
-rw-r--r--src/testdir/test_terminal.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index 549fdd16f..d682a1975 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -2634,4 +2634,22 @@ func Test_term_and_startinsert()
call delete('XTest_startinsert')
endfunc
+" Test for passing invalid arguments to terminal functions
+func Test_term_func_invalid_arg()
+ call assert_fails('let b = term_getaltscreen([])', 'E745:')
+ call assert_fails('let p = term_getansicolors([])', 'E745:')
+ call assert_fails('let a = term_getattr(1, [])', 'E730:')
+ call assert_fails('let c = term_getcursor([])', 'E745:')
+ call assert_fails('let l = term_getline([], 1)', 'E745:')
+ call assert_fails('let l = term_getscrolled([])', 'E745:')
+ call assert_fails('let s = term_getsize([])', 'E745:')
+ call assert_fails('let s = term_getstatus([])', 'E745:')
+ call assert_fails('let s = term_scrape([], 1)', 'E745:')
+ call assert_fails('call term_sendkeys([], "a")', 'E745:')
+ call assert_fails('call term_setansicolors([], [])', 'E745:')
+ call assert_fails('call term_setapi([], "")', 'E745:')
+ call assert_fails('call term_setrestore([], "")', 'E745:')
+ call assert_fails('call term_setkill([], "")', 'E745:')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab