summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMark-Jason Dominus <mjd@plover.com>2002-04-01 20:32:18 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-04-01 20:16:46 +0000
commitcf8feb78124b90756575c16fb087f9e129ee3a6d (patch)
tree74d27b299f9b8e90430294fe5b7672c140877304 /t
parent75e258e97985e881c3ecf10011cdd639fc68778c (diff)
downloadperl-cf8feb78124b90756575c16fb087f9e129ee3a6d.tar.gz
Message-ID: <20020401203218.25230.qmail@plover.com>
p4raw-id: //depot/perl@15667
Diffstat (limited to 't')
-rwxr-xr-xt/op/tiearray.t27
-rw-r--r--t/test.pl20
2 files changed, 37 insertions, 10 deletions
diff --git a/t/op/tiearray.t b/t/op/tiearray.t
index 3d0004b28e..0c9130367e 100755
--- a/t/op/tiearray.t
+++ b/t/op/tiearray.t
@@ -101,7 +101,7 @@ sub SPLICE
package main;
-print "1..35\n";
+print "1..36\n";
my $test = 1;
{my @ary;
@@ -196,7 +196,7 @@ foreach $n (@ary)
print "ok ", $test++,"\n";
}
-# (30-33) 20020303 MJD
+# (30-33) 20020303 mjd-perl-patch+@plover.com
@ary = ();
$seen{POP} = 0;
pop @ary; # this didn't used to call POP at all
@@ -222,6 +222,29 @@ print "ok ", $test++,"\n";
untie @ary;
}
+
+# 20020401 mjd-perl-patch+@plover.com
+# Thanks to Dave Mitchell for the small test case
+{ require './test.pl';
+ curr_test(35);
+ local $::TODO = 'Not fixed yet';
+ fresh_perl_is(<<'End_of_Test', "ok", {}, "Core dump in 'leavetry'");
+######## [ID 20020301.011] Core dump in 'leavetry' in 5.7.2
+ my @a;
+
+ sub X::TIEARRAY { bless {}, 'X' }
+
+ sub X::SPLICE {
+ do '/dev/null';
+ die;
+ }
+
+ tie @a, 'X';
+ eval { splice(@a) };
+ print "ok\n"
+End_of_Test
+}
+$test++;
print "not " unless $seen{'DESTROY'} == 2;
print "ok ", $test++,"\n";
diff --git a/t/test.pl b/t/test.pl
index 91daf1ae1b..debce6ed1a 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -30,8 +30,12 @@ END {
# Use this instead of "print STDERR" when outputing failure diagnostic
# messages
sub _diag {
+ return unless @_;
+ my @mess = map { /^#/ ? "$_\n" : "# $_\n" }
+ map { split /\n/ } @_;
my $fh = $TODO ? *STDOUT : *STDERR;
- print $fh @_;
+ print $fh @mess;
+
}
sub skip_all {
@@ -64,8 +68,7 @@ sub _ok {
}
# Ensure that the message is properly escaped.
- _diag map { /^#/ ? "$_\n" : "# $_\n" }
- map { split /\n/ } @mess if @mess;
+ _diag @mess;
$test++;
@@ -241,11 +244,12 @@ sub fail {
}
sub curr_test {
+ $test = shift if @_;
return $test;
}
sub next_test {
- $test++
+ $test++;
}
# Note: can't pass multipart messages since we try to
@@ -512,10 +516,10 @@ sub _fresh_perl {
my $pass = $resolve->($results);
unless ($pass) {
- print STDERR "# PROG: $switch\n$prog\n";
- print STDERR "# EXPECTED:\n", $resolve->(), "\n";
- print STDERR "# GOT:\n$results\n";
- print STDERR "# STATUS: $status\n";
+ _diag "# PROG: \n$prog\n";
+ _diag "# EXPECTED:\n", $resolve->(), "\n";
+ _diag "# GOT:\n$results\n";
+ _diag "# STATUS: $status\n";
}
# Use the first line of the program as a name if none was given