diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-15 12:55:58 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-15 12:55:58 +0100 |
commit | f1551964448607f8222de2d8f0992ea43eb2fe67 (patch) | |
tree | 965aa22ad570f1ed6dfce1daa1621ba8c714b8b3 /src/testdir/test_assert.vim | |
parent | 346418c624f1bc7c04c98907134a2b284e6452dd (diff) | |
download | vim-f1551964448607f8222de2d8f0992ea43eb2fe67.zip |
patch 7.4.1565
Problem: Crash when assert_equal() runs into a NULL string.
Solution: Check for NULL. (Dominique) Add a test.
Diffstat (limited to 'src/testdir/test_assert.vim')
-rw-r--r-- | src/testdir/test_assert.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim index 6d2f80094..df2636d7b 100644 --- a/src/testdir/test_assert.vim +++ b/src/testdir/test_assert.vim @@ -48,6 +48,21 @@ 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_exception('E724:') + call assert_true(v:errors[0] =~ "Expected NULL but got ''") + call remove(v:errors, 0) + endtry +endfunc + + func Test_user_is_happy() smile sleep 300m |