Skip to content

Commit

Permalink
test case for #38 added on a branch
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Feb 23, 2021
1 parent c8cc316 commit cc5d96a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions t/81-examples.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use strict;
use warnings;

use Test::More tests => 5;
use Capture::Tiny qw(capture);
plan( skip_all => "This test fails on Perl 5.12 and earlier probably because of lack of subtest support." ) if $] < 5.014;

diag "good_test_count_and_exception";
{
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;
}

diag "bad_test_count_and_exception";
{
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;
ok 1;
}

0 comments on commit cc5d96a

Please sign in to comment.