Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl
- use warnings;
- use strict;
- use Test::More;
- use Test::Exception;
- subtest 'Testing dies_ok inside a subtest' => sub {
- dies_ok {
- subtest 'Subtest inside dies_ok' => sub {
- die;
- };
- } 'Die inside subtest';
- };
- done_testing();
- 1;
- __END__
- =head1
- Test::More 0.96
- Test::Builder 0.98
- Test::Exception 0.31
- Output from running the above:
- # Child (Subtest inside dies_ok) exited without calling finalize()
- not ok 1 - Subtest inside dies_ok
- # Failed test 'Subtest inside dies_ok'
- # at /.../Test/Builder.pm line 252.
- ok 2 - Die inside subtest
- 1..2
- Can't call finalize() with child (Subtest inside dies_ok) active at /.../Test/More.pm line 747.
- =cut
Add Comment
Please, Sign In to add comment