Menu

#102 _ck_assert_int should output space around the operator

v1.0 (example)
closed-fixed
nobody
None
5
2015-03-12
2015-02-08
No

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?

Related

Bugs: #102

Discussion

  • Branden Archer

    Branden Archer - 2015-03-12

    Thanks for your interest in Check!

    Has there been a compelling reason to leave the spaces out?

    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:


    Status: open
    Group: v1.0 (example)
    Created: Sun Feb 08, 2015 09:16 AM UTC by Roland Illig
    Last Updated: Sun Feb 08, 2015 09:16 AM UTC
    Owner: nobody

    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?

    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/check/bugs/102/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #102

  • Branden Archer

    Branden Archer - 2015-03-12
    • status: open --> closed-fixed
     

Log in to post a comment.