With done_testing(), it is valid to run tests before outputting the plan.
my $TAP_STREAM = *STDOUT;
my $DIAG_STREAM = *STDERR;
+for ($TAP_STREAM, $DIAG_STREAM) {
+ my $fh = select $_;
+ $|++;
+ select $fh;
+}
+
my ($plan, $test, $failed, $no_diag, $done_testing);
sub NO_PLAN () { -1 }
croak("plan() doesn't understand @args");
}
- {
- my $fh = select $TAP_STREAM;
- $|++;
- select $fh;
- }
-
if (defined $plan_str) {
local $\;
print $TAP_STREAM "$plan_str\n";