comparison src/testdir/test_float_func.vim @ 26650:a07323eb647f v8.2.3854

patch 8.2.3854: Vim9: inconsistent arguments for test functions Commit: https://github.com/vim/vim/commit/86b3ab4fa0de3e8884ab6a6ced2a70592b937d0f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 19 18:33:23 2021 +0000 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 19 Dec 2021 19:45:03 +0100
parents 10605253d009
children 4c16acb2525f
comparison
equal deleted inserted replaced
26649:8a10ad703e92 26650:a07323eb647f
244 call assert_equal('123456.789', string(str2float("1'2'3'4'5'6.789", 1))) 244 call assert_equal('123456.789', string(str2float("1'2'3'4'5'6.789", 1)))
245 call assert_equal('1.0', string(str2float("1''2.3", 1))) 245 call assert_equal('1.0', string(str2float("1''2.3", 1)))
246 call assert_equal('123456.7', string(str2float("123'456.7'89", 1))) 246 call assert_equal('123456.7', string(str2float("123'456.7'89", 1)))
247 247
248 call assert_equal(1.2, str2float(1.2, 0)) 248 call assert_equal(1.2, str2float(1.2, 0))
249 call CheckDefAndScriptFailure2(['str2float(1.2)'], 'E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1') 249 call CheckDefAndScriptFailure(['str2float(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
250 call assert_fails("call str2float([])", 'E730:') 250 call assert_fails("call str2float([])", 'E730:')
251 call assert_fails("call str2float({})", 'E731:') 251 call assert_fails("call str2float({})", 'E731:')
252 call assert_fails("call str2float(function('string'))", 'E729:') 252 call assert_fails("call str2float(function('string'))", 'E729:')
253 endfunc 253 endfunc
254 254