diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-05-06 12:20:05 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-05-06 12:20:05 +0100 |
commit | 12e7a1fe7527e9e59adbe248a95b4b532e3ec58c (patch) | |
tree | a2093d843d4cb1614ccde676f19eddf668ce8321 /src/testdir/test_assert.vim | |
parent | 70e8028a4d63c83f67bc3314d064613e2041e462 (diff) |
patch 9.0.1511: crash when using wrong arg types to assert_match()v9.0.1511
Problem: Crash when using wrong arg types to assert_match().
Solution: Check for NULL pointer. (closes #12349)
Diffstat (limited to 'src/testdir/test_assert.vim')
-rw-r--r-- | src/testdir/test_assert.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim index b7530bf1b9..d143f19f59 100644 --- a/src/testdir/test_assert.vim +++ b/src/testdir/test_assert.vim @@ -335,6 +335,23 @@ func Test_assert_fail_fails() call remove(v:errors, 0) endfunc +func Test_assert_wrong_arg_emsg_off() + CheckFeature folding + + new + call setline(1, ['foo', 'bar']) + 1,2fold + + " This used to crash Vim + let &l:foldtext = 'assert_match({}, {})' + redraw! + + let &l:foldtext = 'assert_equalfile({}, {})' + redraw! + + bwipe! +endfunc + func Test_assert_fails_in_try_block() try call assert_equal(0, assert_fails('throw "error"')) |