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:
Shougo Matsushita 2016-10-06 23:49:50 +09:00
parent 79d77da8a0
commit 3bb388664d
2 changed files with 16 additions and 1 deletions

View File

@ -878,7 +878,7 @@ static int included_patches[] = {
1568,
1567,
// 1566 NA
// 1565,
1565,
// 1564,
// 1563,
// 1562 NA

View File

@ -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}])