When std.assertEqual fails, the error message it produces includes the values that were passed in. This PR uses std.escapeStringJson to escape strings passed to std.assertEqual. Other values are concatenated as normal (relying on the string concatenation to stringize them as before).
An alternative is to call std.manifestJson on both arguments regardless of type. However it's not clear to me that std.manifestJson will produce the same output as the (internal) toString performed by string concatenation.
PR adds test cases for std.assertEqual with two unequal strings and with two unequal objects.
Fixes #363.
When
std.assertEqual
fails, the error message it produces includes the values that were passed in. This PR usesstd.escapeStringJson
to escape strings passed tostd.assertEqual
. Other values are concatenated as normal (relying on the string concatenation to stringize them as before).An alternative is to call
std.manifestJson
on both arguments regardless of type. However it's not clear to me thatstd.manifestJson
will produce the same output as the (internal)toString
performed by string concatenation.PR adds test cases for std.assertEqual with two unequal strings and with two unequal objects.