Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix error on pass/fail. #4
  • Loading branch information
cho45 committed Jul 9, 2013
1 parent 8affa17 commit 29f8127
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions META.json
Expand Up @@ -29,6 +29,7 @@
"requires" : {
"ExtUtils::MakeMaker" : "6.36",
"Test::Differences" : "0",
"Test::Fatal" : "0",
"Test::More" : "0"
}
},
Expand Down
1 change: 1 addition & 0 deletions cpanfile
Expand Up @@ -6,4 +6,5 @@ on build => sub {
requires 'ExtUtils::MakeMaker', '6.36';
requires 'Test::Differences';
requires 'Test::More';
requires 'Test::Fatal';
};
1 change: 1 addition & 0 deletions lib/Test/Name/FromLine.pm
Expand Up @@ -16,6 +16,7 @@ our %filecache;
no warnings 'redefine';
my $ORIGINAL_ok = \&Test::Builder::ok;
*Test::Builder::ok = sub {
@_ = @_; # for pass and fail
$_[2] = do {
my ($package, $filename, $line) = caller($Test::Builder::Level);
undef $filename if $filename eq '-e';
Expand Down
8 changes: 4 additions & 4 deletions t/02_invalid_level.t
@@ -1,14 +1,14 @@
use strict;
use warnings;
use lib 'lib';
use Test::More;
use Test::Name::FromLine;
use Test::Fatal;


eval {
is exception {
local $Test::Builder::Level = 9999;
ok 1;
};

ok !$@;
}, undef;

done_testing;
13 changes: 13 additions & 0 deletions t/03_pass.t
@@ -0,0 +1,13 @@
use strict;
use warnings;
use lib 'lib';
use Test::More;
use Test::Name::FromLine;
use Test::Fatal;

is exception {
pass "foo";
}, undef;

done_testing;

0 comments on commit 29f8127

Please sign in to comment.