-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test cases for - Exceptions are swallowed when tests exceed count -
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
use Capture::Tiny qw(capture); | ||
|
||
subtest good_test_count_and_exception => sub { | ||
my ($out, $err, $exit) = capture { system "$^X t/examples/good-test-count-and-exception.pl" }; | ||
is $exit, 256; | ||
cmp_ok index($out, 'not ok 3 - mytest died'), '>', 0; | ||
cmp_ok index($out, '123123'), '>', 0; | ||
cmp_ok index($err, 'mytest died'), '>', 0; | ||
}; | ||
|
||
subtest bad_test_count_and_exception => sub { | ||
my ($out, $err, $exit) = capture { system "$^X t/examples/bad-test-count-and-exception.pl" }; | ||
#is $exit, 256; | ||
#cmp_ok index($out, 'not ok 3 - mytest died'), '>', 0; | ||
#cmp_ok index($out, '123123'), '>', 0; | ||
#cmp_ok index($err, 'mytest died'), '>', 0; | ||
pass; | ||
}; | ||
|
||
|
||
done_testing; | ||
|
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,15 @@ | ||
package Test; | ||
|
||
use Test::More; | ||
plan tests => 1; | ||
|
||
use parent qw( Test::Class ); | ||
|
||
sub mytest : Tests(1) { | ||
ok 1; | ||
ok 1; | ||
|
||
die 123123; | ||
} | ||
|
||
__PACKAGE__->new()->runtests(); |
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,15 @@ | ||
package Test; | ||
|
||
use Test::More; | ||
plan tests => 1; | ||
|
||
use parent qw( Test::Class ); | ||
|
||
sub mytest : Tests(2) { | ||
ok 1; | ||
ok 1; | ||
|
||
die 123123; | ||
} | ||
|
||
__PACKAGE__->new()->runtests(); |