When ck_assert_int_gt(1 + 2, 3 + 4)
fails, it outputs a string like this:
Assertion '1 + 2>3 + 4' failed: 1 + 2==3, 3 + 4==7
This doesn’t look nice, since most programmers write spaces around comparison operators. Therefore, the assertion message should do the same.
Assertion '1 + 2 > 3 + 4' failed: 1 + 2 == 3, 3 + 4 == 7
For condensed code, it would look like this:
Assertion '1+2 > 3+4' failed: 1+2 == 3, 3+4 == 7
I think the versions with the spaces look nicer than those without.
Has there been a compelling reason to leave the spaces out?
Thanks for your interest in Check!
Not sure that it occurred to anyone before to leave extra space. From your
examples it certainly seems appealing to have the extra space around the
comparison operators. The change is simple enough, and does improve the
readability. I'll push a change to update the various ch_assert_* calls to
add the extra space.
Branden
On Sun, Feb 8, 2015 at 4:16 AM, Roland Illig rillig@users.sf.net wrote:
Related
Bugs:
#102