You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I acknowledge that in many contexts people use chars to represent - well - characters. However, in many cases they are actually holding things that are not "printable" characters. And even when they are printable it is hard to know just how they should be printed.
FAILED!
REQUIRE( one == another_one )
with expansion:
REQUIRE ( 1 == 1 )
Options seem to be
Print a 2 character expansion of "reserved" chars eg output one as '\1' and of course, '' for the dreaded \
Or concede that chars are just very short integers that may well be used to represent characters (which ones is highly dependent on locale) and "promote" them (in effect or literally) by printing them as integers. This is conventional/expected in C/C++ anyway? Far more expected than this:
it really is confusing in it's current form - I took the stringification from Catch (including this) which behaves the same way - I will rework it to just print chars as integers.
I acknowledge that in many contexts people use chars to represent - well - characters. However, in many cases they are actually holding things that are not "printable" characters. And even when they are printable it is hard to know just how they should be printed.
The current behaviour is surprising (imho) - eg:
char one = 1;
char another_one = '1';
REQUIRE(one == another_one);
FAILED!
REQUIRE( one == another_one )
with expansion:
REQUIRE ( 1 == 1 )
Options seem to be
Print a 2 character expansion of "reserved" chars eg output one as '\1' and of course, '' for the dreaded \
Or concede that chars are just very short integers that may well be used to represent characters (which ones is highly dependent on locale) and "promote" them (in effect or literally) by printing them as integers. This is conventional/expected in C/C++ anyway? Far more expected than this:
PASSED!
CHECK( one+'0' == another_one )
with expansion:
CHECK( 49 == 1 )
The text was updated successfully, but these errors were encountered: