use strict; use warnings; use Test::More; sub fail_ok (&;@) { my ($code,$description) = @_; my $result; TODO: { local $TODO= "should be silent"; my $result = $code->(); } $result ? fail($description) : pass($description); } fail_ok { is(1,2,"") } "Bingo! Test failed"; done_testing; #### -*- mode: compilation; default-directory: "d:/exp/" -*- Compilation started at Fri Jul 24 13:02:20 C:/Perl_524/bin\perl.exe -w d:/exp/pm_negate_test.pl not ok 1 - # TODO should be silent # Failed (TODO) test '' # at d:/exp/pm_negate_test.pl line 21. # got: '1' # expected: '2' ok 2 - Bingo! Test failed 1..2 Compilation finished at Fri Jul 24 13:02:21