diff options
Diffstat (limited to 'cpan/Test-Simple/t/subtest/wstat.t')
-rw-r--r-- | cpan/Test-Simple/t/subtest/wstat.t | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cpan/Test-Simple/t/subtest/wstat.t b/cpan/Test-Simple/t/subtest/wstat.t new file mode 100644 index 0000000000..ee2f19866d --- /dev/null +++ b/cpan/Test-Simple/t/subtest/wstat.t @@ -0,0 +1,24 @@ +#!/usr/bin/perl -w + +# Test that setting $? doesn't affect subtest success + +use strict; +use Test::More; + +subtest foo => sub { + plan tests => 1; + $? = 1; + pass('bar'); +}; + +is $?, 1, "exit code keeps on from a subtest"; + +subtest foo2 => sub { + plan tests => 1; + pass('bar2'); + $? = 1; +}; + +is $?, 1, "exit code keeps on from a subtest"; + +done_testing(4); |