Mercurial > vim
diff src/testdir/test_assert.vim @ 10728:8ba322dad776 v8.0.0254
patch 8.0.0254: error message of assert functions is sometimes incomplete
commit https://github.com/vim/vim/commit/c7b831ca154537505f5a22d01335a86b2e9cb023
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 28 18:08:12 2017 +0100
patch 8.0.0254: error message of assert functions is sometimes incomplete
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 28 Jan 2017 18:15:04 +0100 |
parents | 553f9b9502bc |
children | 7c7e496e625d |
line wrap: on
line diff
--- 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