1#!/usr/bin/perl -w 2 3BEGIN { 4 if( $ENV{PERL_CORE} ) { 5 chdir 't'; 6 @INC = ( '../lib', 'lib' ); 7 } 8 else { 9 unshift @INC, 't/lib'; 10 } 11} 12 13use strict; 14use warnings; 15 16use Test::Builder::NoOutput; 17 18use Test::More tests => 6; 19 20# Formatting may change if we're running under Test::Harness. 21$ENV{HARNESS_ACTIVE} = 0; 22 23{ 24 ok defined &subtest, 'subtest() should be exported to our namespace'; 25 is prototype('subtest'), undef, '... has no prototype'; 26 27 subtest 'subtest with plan', sub { 28 plan tests => 2; 29 ok 1, 'planned subtests should work'; 30 ok 1, '... and support more than one test'; 31 }; 32 subtest 'subtest without plan', sub { 33 plan 'no_plan'; 34 ok 1, 'no_plan subtests should work'; 35 ok 1, '... and support more than one test'; 36 ok 1, '... no matter how many tests are run'; 37 }; 38 subtest 'subtest with implicit done_testing()', sub { 39 ok 1, 'subtests with an implicit done testing should work'; 40 ok 1, '... and support more than one test'; 41 ok 1, '... no matter how many tests are run'; 42 }; 43 subtest 'subtest with explicit done_testing()', sub { 44 ok 1, 'subtests with an explicit done testing should work'; 45 ok 1, '... and support more than one test'; 46 ok 1, '... no matter how many tests are run'; 47 done_testing(); 48 }; 49} 50