Closed lacygoill closed 4 years ago
Sometimes, when an
assert_*()
function uses a code error such asE123
as a pattern, the colon is omitted. As an example, insrc/testdir/test_cmdline.vim
, on line 846,assert_fails()
is invoked like this:call assert_fails('f #<', 'E95')
Even though it works, I think it would be more reliable if a colon was apppended to the error code:
call assert_fails('f #<', 'E95:') ^
This way, there is no risk that the test wrongly passes while the code of the error which was raised starts with
95
but is not95
(e.g.950
).Here is a patch which tries to address this issue:
Thanks. Although it's unlikely another error message is matched, it's better to be consistent.
-- A poem: read aloud:
<> !''# Waka waka bang splat tick tick hash, ^"`$$- Caret quote back-tick dollar dollar dash, !=@$_ Bang splat equal at dollar under-score, %*<> ~#4 Percent splat waka waka tilde number four, &[]../ Ampersand bracket bracket dot dot slash, |{,,SYSTEM HALTED Vertical-bar curly-bracket comma comma CRASH.
Fred Bremmer and Steve Kroese (Calvin College & Seminary of Grand Rapids, MI.)
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\ \\ an exciting new programming language -- http://www.Zimbu.org /// \\ help me help AIDS victims -- http://ICCF-Holland.org ///
Sometimes, when an
assert_*()
function uses a code error such asE123
as a pattern, the colon is omitted. As an example, insrc/testdir/test_cmdline.vim
, on line 846,assert_fails()
is invoked like this:Even though it works, I think it would be more reliable if a colon was apppended to the error code:
This way, there is no risk that the test wrongly passes while the code of the error which was raised starts with
95
but is not95
(e.g.950
).Here is a patch which tries to address this issue: