diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2018-06-07 03:59:45 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-06-07 09:59:45 +0200 |
commit | 7f6c1d256f4c9f78d71b4a605095d3dea0ea7abb (patch) | |
tree | 3611a8a45d2d1d357f1ca25ec9282437a5c38348 /test/functional/legacy/assert_spec.lua | |
parent | 36ac80d5dd58e726a89c7108051e29de500a2f77 (diff) | |
download | rneovim-7f6c1d256f4c9f78d71b4a605095d3dea0ea7abb.tar.gz rneovim-7f6c1d256f4c9f78d71b4a605095d3dea0ea7abb.tar.bz2 rneovim-7f6c1d256f4c9f78d71b4a605095d3dea0ea7abb.zip |
vim-patch:8.0.0254: error message of assert functions (#8488)
Problem: When using an assert function one can either specify a message or
get a message about what failed, not both.
Solution: Concatenate the error with the message.
https://github.com/vim/vim/commit/c7b831ca154537505f5a22d01335a86b2e9cb023
Diffstat (limited to 'test/functional/legacy/assert_spec.lua')
-rw-r--r-- | test/functional/legacy/assert_spec.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/functional/legacy/assert_spec.lua b/test/functional/legacy/assert_spec.lua index 381461dc4f..10703465aa 100644 --- a/test/functional/legacy/assert_spec.lua +++ b/test/functional/legacy/assert_spec.lua @@ -77,6 +77,11 @@ describe('assert function:', function() eq('Vim(call):E724: unable to correctly dump variable with self-referencing container', exc_exec('call CheckAssert()')) end) + + it('can specify a message and get a message about what failed', function() + call('assert_equal', 'foo', 'bar', 'testing') + expected_errors({"testing: Expected 'foo' but got 'bar'"}) + end) end) -- assert_notequal({expected}, {actual}[, {msg}]) @@ -164,10 +169,10 @@ describe('assert function:', function() call assert_true('', 'file two') ]]) expected_errors({ - tmpname_one .. " line 1: 'equal assertion failed'", - tmpname_one .. " line 2: 'true assertion failed'", - tmpname_one .. " line 3: 'false assertion failed'", - tmpname_two .. " line 1: 'file two'", + tmpname_one .. " line 1: equal assertion failed: Expected 1 but got 100", + tmpname_one .. " line 2: true assertion failed: Expected False but got 'true'", + tmpname_one .. " line 3: false assertion failed: Expected True but got 'false'", + tmpname_two .. " line 1: file two: Expected True but got ''", }) end) @@ -198,7 +203,7 @@ describe('assert function:', function() it('should set v:errors to msg when given and match fails', function() call('assert_match', 'bar.*foo', 'foobar', 'wrong') - expected_errors({"'wrong'"}) + expected_errors({"wrong: Pattern 'bar.*foo' does not match 'foobar'"}) end) end) |