Mercurial > vim
diff src/testdir/test_vim9_builtin.vim @ 24250:01b274c3f69b v8.2.2666
patch 8.2.2666: Vim9: not enough function arguments checked for string
Commit: https://github.com/vim/vim/commit/c580943965fc9b006ec233bdee4ea5380f5594ea
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 27 21:23:30 2021 +0100
patch 8.2.2666: Vim9: not enough function arguments checked for string
Problem: Vim9: not enough function arguments checked for string.
Solution: Check in ch_logfile(), char2nr() and others.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 27 Mar 2021 21:30:02 +0100 |
parents | 883d7ceffd97 |
children | 0868ac82ef18 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -204,14 +204,41 @@ def Test_call_call() l->assert_equal([1, 2, 3]) enddef +def Test_ch_logfile() + assert_fails('ch_logfile(true)', 'E1174') + assert_fails('ch_logfile("foo", true)', 'E1174') +enddef + def Test_char2nr() char2nr('あ', true)->assert_equal(12354) + + assert_fails('char2nr(true)', 'E1174') +enddef + +def Test_charclass() + assert_fails('charclass(true)', 'E1174') +enddef + +def Test_chdir() + assert_fails('chdir(true)', 'E1174') enddef def Test_col() new setline(1, 'asdf') col([1, '$'])->assert_equal(5) + + assert_fails('col(true)', 'E1174') +enddef + +def Test_confirm() + if !has('dialog_con') && !has('dialog_gui') + CheckFeature dialog_con + endif + + assert_fails('call confirm(true)', 'E1174') + assert_fails('call confirm("yes", true)', 'E1174') + assert_fails('call confirm("yes", "maybe", 2, true)', 'E1174') enddef def Test_copy_return_type() @@ -675,6 +702,10 @@ def Test_keys_return_type() var->assert_equal(['a', 'b']) enddef +def Test_line() + assert_fails('line(true)', 'E1174') +enddef + def Test_list2str_str2list_utf8() var s = "\u3042\u3044" var l = [0x3042, 0x3044]