class Test::Builder::TestPlan-0.2.1 { has Int $!expect; submethod BUILD ( $!expect = 0 ) { fail "Invalid or missing plan" unless defined $!expect; } method header returns Str { return "1..$!expect"; } method footer returns Str (Int $run) { return '' if $run == $!expect; return "Expected $.expect but ran $run"; } } # XXX: extract the useful similarities into a role # cannot inherit from TestPlan because of the lack of $!expect class Test::Builder::NullPlan { method header returns Str { return ''; } method footer returns Str (Int $run) { return "1..$run"; } } =pod =head1 NAME Test::Builder::TestPlan =head1 SYNOPSIS use Test::Builder::TestPlan; =head1 DESCRIPTION This file contains both the Test::Builder::TestPlan object and a subclass, Test::Builder::NullPlan. Test::Builder::NullPlan is roughly equivalent to C in the Perl 5 Test::Builder. =head1 PUBLIC ATTRIBUTES =over 4 =item B The number of tests expected to run. =back =head1 METHODS =over 4 =item B
Returns a string containing the TAP header for this plan. =item B