Parse error if assert message is empty
stefanbesler opened this issue · 3 comments
Writing a Unitest that doesn't have an explicit message for an assert, results in a parsing error.
I know, the message is useful, but can you default to a message if none is given explicitly? I don't think it should be necessary to give a detailed message. It'd prefer a simple default like "assertion failed, 5!=4" (if message is empty).
AssertEquals(5, 4, '');
results in
ERROR: While parsing TcUnit results, expected TEST_ASSERT_MESSAGE but got TEST_ASSERT_TYPE
when used together with TcUnit-Runner, no xml file is generated although other tests use explicit messages.
I am using
TcUnit 1.1.0.0
TcUnit-Runner 0.9.1.0
Good catch! As you say, it should not be a requirement to have a message. I think the best way is to have the TcUnit-Runner either expect a test-assert-message OR the test-assert-type (in other words, no message needs to be provided).
@stefanbesler By the way, if you want and agree on the above suggestion, you're welcome to create a PR and I'll merge your changes in.
Solved in c554610. Thanks @stefanbesler !