in reply to Re^3: Testing image output
in thread Testing image output

To convince yourself this is a worthwhile change, try running some failing test cases with your original ok and compare with cmp_ok

I took this advice...
As expected, I get a more verbose output.

But, I don't see how it is any more helpful:

# Testing horizontal image # Failed test 'Correct centre image from horizontal' # at t/02-image.t line 41. # got: '33220702a62b38deb37ef0ce0b4a1a22' # expected: 'c97e63fc792ef75b5ff49c078046321e' # Failed test 'Correct left image from horizontal' # at t/02-image.t line 43. # got: '4a0e69414c9603b0437d22841ef0d300' # expected: '20a5c6517316ebef4c255c12f991dbc7'

Replies are listed 'Best First'.
Re^5: Testing image output
by hippo (Archbishop) on Sep 13, 2023 at 23:05 UTC

    It is (arguably) more helpful because you now have this extra information:

    1. The computed string (the "got") actually looks like a digest of the right length and the right alphabet. This tells you that the code producing that string is performing the right action, just on the wrong source data. Before, the string could have been "" or "aaaaa" or "I can haz cheeseburger" for all you knew.
    2. The computed and expected strings are entirely different, not just say one character out so you have not introduced a typo in the expected string.

    You now have more confidence that the underlying problem is indeed that the source data for the digest is not what it should be, rather than some issue elsewhere in your code or your test script.


    🦛