diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-07-16 11:44:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-16 03:44:17 +0000 |
commit | a553b3687668d055e4c2703fce2aea3ae1140374 (patch) | |
tree | 6acab363e1ee96a2e00798c108ba090e83045b9a | |
parent | 42829bf5d7df2102345f3c7597eda5da076bab9e (diff) | |
download | rneovim-a553b3687668d055e4c2703fce2aea3ae1140374.tar.gz rneovim-a553b3687668d055e4c2703fce2aea3ae1140374.tar.bz2 rneovim-a553b3687668d055e4c2703fce2aea3ae1140374.zip |
vim-patch:7.4.1565 (#29734)
Problem: Crash when assert_equal() runs into a NULL string.
Solution: Check for NULL. (Dominique) Add a test.
https://github.com/vim/vim/commit/f1551964448607f8222de2d8f0992ea43eb2fe67
Use the latest version of the test from Vim.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r-- | test/old/testdir/test_assert.vim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/old/testdir/test_assert.vim b/test/old/testdir/test_assert.vim index fe093d3582..bc79ef9296 100644 --- a/test/old/testdir/test_assert.vim +++ b/test/old/testdir/test_assert.vim @@ -189,6 +189,22 @@ func Test_wrong_error_type() call assert_equal(type([]), type(verrors)) endfunc +func Test_compare_fail() + let s:v = {} + let s:x = {"a": s:v} + let s:v["b"] = s:x + let s:w = {"c": s:x, "d": ''} + try + call assert_equal(s:w, '') + catch + call assert_equal(0, assert_exception('E724:')) + " Nvim: expected value isn't shown as NULL + " call assert_match("Expected NULL but got ''", v:errors[0]) + call assert_match("Expected .* but got ''", v:errors[0]) + call remove(v:errors, 0) + endtry +endfunc + func Test_match() call assert_equal(0, assert_match('^f.*b.*r$', 'foobar')) |