summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2002-08-25 21:13:03 -0700
committerhv <hv@crypt.org>2002-08-26 15:07:21 +0000
commit60ffb3081afd811893be4fb73d870ed1a5c9ca72 (patch)
tree66625e15ba3405ed3b9f6a9b90c5320df14be540 /t
parentcd9c2b4e96008c6ff95ba47e81d068a5615dfccc (diff)
downloadperl-60ffb3081afd811893be4fb73d870ed1a5c9ca72.tar.gz
[ANNOUNCE] Test::Simple 0.47
Message-ID: <20020826111303.GJ758@ool-18b93024.dyn.optonline.net> p4raw-id: //depot/perl@17783
Diffstat (limited to 't')
-rw-r--r--t/lib/Test/Simple/sample_tests/pre_plan_death.plx17
-rw-r--r--t/lib/TieOut.pm10
2 files changed, 20 insertions, 7 deletions
diff --git a/t/lib/Test/Simple/sample_tests/pre_plan_death.plx b/t/lib/Test/Simple/sample_tests/pre_plan_death.plx
new file mode 100644
index 0000000000..f72d3b65e5
--- /dev/null
+++ b/t/lib/Test/Simple/sample_tests/pre_plan_death.plx
@@ -0,0 +1,17 @@
+# ID 20020716.013, the exit code would become 0 if the test died
+# before a plan.
+
+require Test::Simple;
+
+push @INC, 't/lib';
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+
+close STDERR;
+die "Knife?";
+
+Test::Simple->import(tests => 3);
+
+ok(1);
+ok(1);
+ok(1);
diff --git a/t/lib/TieOut.pm b/t/lib/TieOut.pm
index 072e8fdef6..aa49465200 100644
--- a/t/lib/TieOut.pm
+++ b/t/lib/TieOut.pm
@@ -9,15 +9,11 @@ sub PRINT {
$$self .= join('', @_);
}
-sub PRINTF {
- my $self = shift;
- my $fmt = shift;
- $$self .= sprintf $fmt, @_;
-}
-
sub read {
my $self = shift;
- return substr($$self, 0, length($$self), '');
+ my $out = $$self;
+ $$self = '';
+ return $out;
}
1;