diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-11-05 12:33:10 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-05 12:47:25 +0800 |
| commit | 6956971ec790e636b16eeaec798c826515da9834 (patch) | |
| tree | f48445ed4f2cb998a56ef56709ef4a87c8411e0d /src/nvim/testdir/test_assert.vim | |
| parent | 02f80d9a8a560a93142bcebf324ba14cde4dd1b5 (diff) | |
| download | rneovim-6956971ec790e636b16eeaec798c826515da9834.tar.gz rneovim-6956971ec790e636b16eeaec798c826515da9834.tar.bz2 rneovim-6956971ec790e636b16eeaec798c826515da9834.zip | |
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.
https://github.com/vim/vim/commit/44d6652d561d628d12e3ff7f6636ea7d1f805ced
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir/test_assert.vim')
| -rw-r--r-- | src/nvim/testdir/test_assert.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_assert.vim b/src/nvim/testdir/test_assert.vim index 0ba45d0b13..431908e95c 100644 --- a/src/nvim/testdir/test_assert.vim +++ b/src/nvim/testdir/test_assert.vim @@ -255,6 +255,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() |