summaryrefslogtreecommitdiff
path: root/src/testdir/test_assert.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-28 18:08:12 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-28 18:08:12 +0100
commitc7b831ca154537505f5a22d01335a86b2e9cb023 (patch)
treee6cfed108ac6001743480ced4763d632dca45777 /src/testdir/test_assert.vim
parent36ae89c550a4f0a380606c3fb4a054957ad698f0 (diff)
downloadvim-git-c7b831ca154537505f5a22d01335a86b2e9cb023.tar.gz
patch 8.0.0254: error message of assert functions is sometimes incompletev8.0.0254
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.
Diffstat (limited to 'src/testdir/test_assert.vim')
-rw-r--r--src/testdir/test_assert.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim
index 8c54bddb8..986f0d9a7 100644
--- a/src/testdir/test_assert.vim
+++ b/src/testdir/test_assert.vim
@@ -121,6 +121,12 @@ func Test_assert_inrange()
call assert_fails('call assert_inrange(1, 1)', 'E119:')
endfunc
+func Test_assert_with_msg()
+ call assert_equal('foo', 'bar', 'testing')
+ call assert_match("testing: Expected 'foo' but got 'bar'", v:errors[0])
+ call remove(v:errors, 0)
+endfunc
+
func Test_user_is_happy()
smile
sleep 300m