diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-06 22:26:57 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-06 22:26:57 +0200 |
commit | 44d6652d561d628d12e3ff7f6636ea7d1f805ced (patch) | |
tree | d56a1089639a79cb532db4dac3b0089e3ef27254 /src/testdir/test_assert.vim | |
parent | 9bd5d879c2ecfbdbb168b090e12f4b89724a302e (diff) |
patch 8.2.1632: not checking the context of test_fails()v8.2.1632
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.
Diffstat (limited to 'src/testdir/test_assert.vim')
-rw-r--r-- | src/testdir/test_assert.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim index 1a18799f5d..47dcc1f1e8 100644 --- a/src/testdir/test_assert.vim +++ b/src/testdir/test_assert.vim @@ -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() |