mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.1565
Problem: Crash when assert_equal() runs into a NULL string.
Solution: Check for NULL. (Dominique) Add a test.
f155196444
This commit is contained in:
parent
79d77da8a0
commit
3bb388664d
@ -878,7 +878,7 @@ static int included_patches[] = {
|
||||
1568,
|
||||
1567,
|
||||
// 1566 NA
|
||||
// 1565,
|
||||
1565,
|
||||
// 1564,
|
||||
// 1563,
|
||||
// 1562 NA
|
||||
|
@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
|
||||
local nvim, call = helpers.meths, helpers.call
|
||||
local clear, eq = helpers.clear, helpers.eq
|
||||
local source, execute = helpers.source, helpers.execute
|
||||
local exc_exec = helpers.exc_exec
|
||||
|
||||
local function expected_errors(errors)
|
||||
eq(errors, nvim.get_vvar('errors'))
|
||||
@ -62,6 +63,20 @@ describe('assert function:', function()
|
||||
call('assert_equal', 'true', 'false')
|
||||
expected_errors({"Expected 'true' but got 'false'"})
|
||||
end)
|
||||
|
||||
it('should change v:errors when expected is not equal to actual', function()
|
||||
source([[
|
||||
function CheckAssert()
|
||||
let s:v = {}
|
||||
let s:x = {"a": s:v}
|
||||
let s:v["b"] = s:x
|
||||
let s:w = {"c": s:x, "d": ''}
|
||||
call assert_equal(s:w, '')
|
||||
endfunction
|
||||
]])
|
||||
eq('Vim(call):E724: unable to correctly dump variable with self-referencing container',
|
||||
exc_exec('call CheckAssert()'))
|
||||
end)
|
||||
end)
|
||||
|
||||
-- assert_notequal({expected}, {actual}[, {msg}])
|
||||
|
Loading…
Reference in New Issue
Block a user