in reply to Re: 0==undef, that's annoying. Is it?
in thread 0==undef, that's annoying. Is it?

I hadn't even noticed it produced a warning. Which was at the very start of the TAP output, while the end of the TAP output indicated that all tests passed.

Test::NoWarnings does the trick, than you :o)
I tried to turn warnings to fatal with

use warnings qw(FATAL all);
as indicated here using FATAL warnings, but it didn't work. It might/could be because of Windows, who doesn't like signals? I'm guessing that FATAL is maybe catching the WARN signal and making it die. But in Windows i found i couldn't catch any signals. It doesn't really matter for me right now : Test::NoWarnings works. Cheers!

PS : the problem was wider than i thought : 1>undef also returns true. Which means that any cmp_ok($got, '<', $expected) statement runs into the same risk / problem.
I'll add this to the first post.

Replies are listed 'Best First'.
Re^3: 0==undef, that's annoying. Is it?
by mascip (Pilgrim) on Jul 19, 2012 at 12:51 UTC

    Just as a note for other people :
    Test::NoWarnings does the job, but it means that no warnings will be printed until the end of the tests. Which means that you cannot use Smart::Comments, and cannot use warn() to debug.