examples/perl/t/planned_subtest.t
use strict;
use warnings;

use lib 'lib';
use MyTools;

use Test::More tests => 3;

is sum(1, 1), 2,  '1+1';

subtest negatives => sub {
    plan tests => 2;
    is sum(-1, -1), -2, '-1, -1';
    is sum(-1, -1, -1), -3, '-1, -1, -1';
};

is sum(2, 2), 4,  '2+2';

perl t/planned_subtest.t

1..3
ok 1 - 1+1
    # Subtest: negatives
    1..2
    ok 1 - -1, -1
    not ok 2 - -1, -1, -1
    #   Failed test '-1, -1, -1'
    #   at t/planned_subtest.t line 14.
    #          got: '-2'
    #     expected: '-3'
    # Looks like you failed 1 test of 2.
not ok 2 - negatives
#   Failed test 'negatives'
#   at t/planned_subtest.t line 15.
ok 3 - 2+2
# Looks like you failed 1 test of 3.

prove t/planned_subtest.t

t/planned_subtest.t .. 1/3     
    #   Failed test '-1, -1, -1'
    #   at t/planned_subtest.t line 14.
    #          got: '-2'
    #     expected: '-3'
    # Looks like you failed 1 test of 2.

#   Failed test 'negatives'
#   at t/planned_subtest.t line 15.
# Looks like you failed 1 test of 3.
t/planned_subtest.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests 

Test Summary Report
-------------------
t/planned_subtest.t (Wstat: 256 Tests: 3 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
Files=1, Tests=3,  0 wallclock secs
  ( 0.03 usr  0.00 sys +  0.02 cusr  0.00 csys =  0.05 CPU)
Result: FAIL