diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-05-06 20:00:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-06 20:00:17 +0800 |
commit | ca5a810c4a67c9c3f482d0c015270c26aee2c943 (patch) | |
tree | a8f2de41d37f356fd075996a9bc439b6cf4946c3 /test | |
parent | a67b76943a1e823e710be382f6e57fb0eff2c1a8 (diff) | |
download | rneovim-ca5a810c4a67c9c3f482d0c015270c26aee2c943.tar.gz rneovim-ca5a810c4a67c9c3f482d0c015270c26aee2c943.tar.bz2 rneovim-ca5a810c4a67c9c3f482d0c015270c26aee2c943.zip |
vim-patch:9.0.1511: crash when using wrong arg types to assert_match() (#23507)
Problem: Crash when using wrong arg types to assert_match().
Solution: Check for NULL pointer. (closes vim/vim#12349)
https://github.com/vim/vim/commit/12e7a1fe7527e9e59adbe248a95b4b532e3ec58c
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_assert.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/old/testdir/test_assert.vim b/test/old/testdir/test_assert.vim index 57d11d0e3a..bc4e07e7c6 100644 --- a/test/old/testdir/test_assert.vim +++ b/test/old/testdir/test_assert.vim @@ -324,6 +324,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"')) |