-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #369 from nnutter/master
fix bug when test_fail is called via a do statement (for 0.98 series)
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Test::Builder::Tester tests => 3; | ||
use Test::More; | ||
use File::Basename qw(dirname); | ||
use File::Spec qw(); | ||
|
||
my $file = File::Spec->join(dirname(__FILE__), 'tbt_09do_script.pl'); | ||
my $done = do $file; | ||
ok(defined($done), 'do succeeded') or do { | ||
if ($@) { | ||
diag qq( \$@ is '$@'\n); | ||
} elsif ($!) { | ||
diag qq( \$! is '$!'\n); | ||
} else { | ||
diag qq( file's last statement returned undef: $file) | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use warnings; | ||
|
||
isnt($0, __FILE__, 'code is not executing directly'); | ||
|
||
test_out("not ok 1 - one"); | ||
test_fail(+1); | ||
ok(0,"one"); | ||
test_test('test_fail caught fail message inside a do'); | ||
|
||
1; |