• Knusper@feddit.de
    link
    fedilink
    English
    arrow-up
    20
    arrow-down
    1
    ·
    2 years ago

    One time while coding, I managed to get as test output:

    Expected: Success
       Found: Success
    

    Thankfully, I knew immediately how I fucked up, otherwise this would’ve been a rather unfun debugging session…

    • SpaceNoodle
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 years ago

      Fucking up your printf arguments is a time-honored tradition

      • Knusper@feddit.de
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 years ago

        Not in this case, I’m afraid.

        A library was returning a singleton Success-object (as opposed to several failure cases) and I decided to introduce an own type for that, but which also had a singleton Success-object. And well, I forgot to adjust the test assertion accordingly.

        So, those were actually different objects from different classes being compared. But when displaying the test result to me, their .toString() yielded exactly the same: Success

  • TempleSquare@lemmy.ml
    link
    fedilink
    English
    arrow-up
    13
    ·
    2 years ago

    You’re bringing back nightmares from grad school. The “online” homework problems… Shudder.

  • betterdeadthanreddit
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 years ago

    Makes me wonder whether there’s a whitespace character getting included in the comparison. Lowest bid developer doing lowest bid developer things.