vim-patch:7.4.1565 (#29734)

Problem:    Crash when assert_equal() runs into a NULL string.
Solution:   Check for NULL. (Dominique) Add a test.

f155196444

Use the latest version of the test from Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq 2024-07-16 11:44:17 +08:00 committed by GitHub
parent 42829bf5d7
commit a553b36876
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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'))