1
0
forked from aniani/vim

patch 8.2.1632: not checking the context of test_fails()

Problem:    Not checking the context of test_fails().
Solution:   Add the line number and context arguments.  Give error if
            assert_fails() argument types are wrong.
This commit is contained in:
Bram Moolenaar
2020-09-06 22:26:57 +02:00
parent 9bd5d879c2
commit 44d6652d56
6 changed files with 63 additions and 29 deletions

View File

@@ -269,6 +269,20 @@ func Test_assert_fail_fails()
let exp = v:exception
endtry
call assert_match("E856: assert_fails() second argument", exp)
try
call assert_equal(1, assert_fails('xxx', 'E492', '', 'burp'))
catch
let exp = v:exception
endtry
call assert_match("E1115: assert_fails() fourth argument must be a number", exp)
try
call assert_equal(1, assert_fails('xxx', 'E492', '', 54, 123))
catch
let exp = v:exception
endtry
call assert_match("E1116: assert_fails() fifth argument must be a string", exp)
endfunc
func Test_assert_fails_in_try_block()