0
0
mirror of https://github.com/vim/vim.git synced 2025-10-20 08:14:18 -04:00

patch 8.2.3854: Vim9: inconsistent arguments for test functions

Problem:    Vim9: inconsistent arguments for test functions.
Solution:   When :def function and script have different arguments use a list
            with two items instead of a separate function.
This commit is contained in:
Bram Moolenaar
2021-12-19 18:33:23 +00:00
parent 700e6b1662
commit 86b3ab4fa0
13 changed files with 1007 additions and 995 deletions

View File

@@ -174,7 +174,7 @@ func Test_strwidth()
if has('float')
call assert_equal(3, strwidth(1.2))
call CheckDefAndScriptFailure2(['echo strwidth(1.2)'], 'E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1')
call CheckDefAndScriptFailure(['echo strwidth(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
endif
set ambiwidth&
@@ -241,7 +241,7 @@ func Test_str2nr()
call assert_fails('call str2nr({->2})', 'E729:')
if has('float')
call assert_equal(1, str2nr(1.2))
call CheckDefAndScriptFailure2(['echo str2nr(1.2)'], 'E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1')
call CheckDefAndScriptFailure(['echo str2nr(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
endif
call assert_fails('call str2nr(10, [])', 'E745:')
endfunc
@@ -503,7 +503,7 @@ func Test_simplify()
call assert_fails('call simplify({})', 'E731:')
if has('float')
call assert_equal('1.2', simplify(1.2))
call CheckDefAndScriptFailure2(['echo simplify(1.2)'], 'E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1')
call CheckDefAndScriptFailure(['echo simplify(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
endif
endfunc