forked from aniani/vim
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.
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user