- done_testing
subtest with implicit done_testing
examples/test-more/t/subtest.t
use strict; use warnings; use MySimpleCalc qw(sum); use Test::More; subtest positives => sub { is sum(1, 1), 2, '1+1'; is sum(2, 2), 4, '2+2'; }; subtest negatives => sub { is sum(-1, -1), -2, '-1, -1'; is sum(-1, -1, -1), -3, '-1, -1, -1'; }; done_testing;
# Failed test '-1, -1, -1' # at t/subtest.t line 15. # got: '-2' # expected: '-3' # Looks like you failed 1 test of 2. # Failed test 'negatives' # at t/subtest.t line 16. # Looks like you failed 1 test of 2. t/subtest.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/2 subtests Test Summary Report ------------------- t/subtest.t (Wstat: 256 Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=1, Tests=2, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.13 cusr 0.00 csys = 0.15 CPU) Result: FAIL
Implicit call to done_testing inside. skip-able, etc.