BAIL_OUT or something else?

Gabor Szabo szabgab at gmail.com
Thu Nov 1 11:13:33 EST 2007


I might be tired or just using old code but something strange going on:


---------------
use Test::More;
plan tests => 1;


is(2+2, 5) or BAIL_OUT("you don't mean it, do you?");
----------------
$ perl x.t
1..1
not ok 1
#   Failed test at x.t line 8.
#          got: '4'
#     expected: '5'
Bail out!  you don't mean it, do you?
-------------------
$ prove x.t
x......1/1 Bailout called.  Further testing stopped:  you don't mean it, do you?
-------------------
prove -v x.t
x......
TYPE: format_plan
1..1
TYPE: format_test
not ok 1
Bailout called.  Further testing stopped:  you don't mean it, do you?



Shouldn't I see the got: '4' expected '5' part in verbose mode?

Actually when I ran it on my real code I got an inconsisten behavior:
sometimes like this, only part of the output was shown:


-----------------
not ok 20

#   Failed test at t/32-login.t line 96.
#          got: '1'
Bailout called.  Further testing stopped:  Number of forms is incorrect?
-----------------

sometimes nothing:

--------------------
not ok 20
Bailout called.  Further testing stopped:  Number of forms is incorrect?
-------------------

using prove t/32-login.t -b -v

prove --version
TAP::Harness v2.99_07 and Perl v5.8.8

Gabor


More information about the tapx-dev mailing list