aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/assert_spec.lua
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2016-10-06 23:49:50 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2016-10-15 14:25:50 +0900
commit3bb388664d0c5ab365a4d8ea1e8efe2bd11cbb90 (patch)
tree3ee85d475341ae59166f2a4c341906faefd0a632 /test/functional/legacy/assert_spec.lua
parent79d77da8a06bf91a77cc96a1f1fba30bbd991a23 (diff)
downloadrneovim-3bb388664d0c5ab365a4d8ea1e8efe2bd11cbb90.tar.gz
rneovim-3bb388664d0c5ab365a4d8ea1e8efe2bd11cbb90.tar.bz2
rneovim-3bb388664d0c5ab365a4d8ea1e8efe2bd11cbb90.zip
vim-patch:7.4.1565
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
Diffstat (limited to 'test/functional/legacy/assert_spec.lua')
-rw-r--r--test/functional/legacy/assert_spec.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/legacy/assert_spec.lua b/test/functional/legacy/assert_spec.lua
index 42dd25023a..8a042be7f7 100644
--- a/test/functional/legacy/assert_spec.lua
+++ b/test/functional/legacy/assert_spec.lua
@@ -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}])