diff options
author | James McCoy <jamessan@jamessan.com> | 2016-10-20 10:28:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-20 10:28:03 -0400 |
commit | 1ad5a970ce2d4750520a0508a4d186634291b316 (patch) | |
tree | 3dfde89bdd3dd48432b370bf4bdd23a6b39e32b9 /test/functional/legacy/assert_spec.lua | |
parent | 978c1fd11fa9709593f4e0539fda7d572c73b9d6 (diff) | |
parent | 3bb388664d0c5ab365a4d8ea1e8efe2bd11cbb90 (diff) | |
download | rneovim-1ad5a970ce2d4750520a0508a4d186634291b316.tar.gz rneovim-1ad5a970ce2d4750520a0508a4d186634291b316.tar.bz2 rneovim-1ad5a970ce2d4750520a0508a4d186634291b316.zip |
Merge pull request #5440 from Shougo/vim-7.4.1565
vim-patch:7.4.1565
Diffstat (limited to 'test/functional/legacy/assert_spec.lua')
-rw-r--r-- | test/functional/legacy/assert_spec.lua | 15 |
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}]) |