Subject: | confusing diagnostic output for isnt for expected = 0 |
Dist: Test-More-0.78
Perl: 5.8.8
OS: Win XP Pro
I wanted to verify a non-zero exit code, so I used:
isnt ($exit_code, 0, "description");
In the case that $exit_code = 0, the output was:
not ok 3 - decoder exit code for invalid header
# Failed test 'decoder exit code for invalid header'
# at lossless_self_test.pl line 425.
# '0'
# ne
# '0'
As you can see, the diagnostics aren't very helpful. The actual exit
code (1) is not even displayed.
I reversed the logic and used 'is' instead, even though it doesn't
capture the true test case (i.e. not 0):
is ($exit_code, 1, "description");
However, at least I got some meaningful diagnostic output:
not ok 3 - decoder exit code for invalid header
# Failed test 'decoder exit code for invalid headerr'
# at lossless_self_test.pl line 424.
# got: '0'
# expected: '1'
It seems as though the diagnostic output for 'isn't', at least in the
case of expected = 0, needs to be looked at.