summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2002-12-02 02:18:19 +0000
committerhv <hv@crypt.org>2002-12-02 02:18:19 +0000
commit6c8d78fb324d7709ee76d3711608bab5f83d721f (patch)
treec26f4a574ccbfe4e2113d6d0297347d1fb640c3b /t
parenta3985cdcc04b13974afc5f4635645003847806e4 (diff)
downloadperl-6c8d78fb324d7709ee76d3711608bab5f83d721f.tar.gz
integrate 5.8-maint: changes #18174 18187 18189-92 18202 18209 18214-5
p4raw-link: @18189 on //depot/maint-5.8/perl: 27314835b1b1ea8730d4a0eb871861ac238c63f9 p4raw-link: @18187 on //depot/maint-5.8/perl: 94e81ce4c47784f86829e70129b1d0a3e95ca51c p4raw-link: @18174 on //depot/maint-5.8/perl: f8d24d869503bcd9df0e86aa5898c89996220bf8 p4raw-id: //depot/perl@18221 p4raw-branched: from //depot/maint-5.8/perl@18220 'branch in' ext/POSIX/t/is.t p4raw-integrated: from //depot/maint-5.8/perl@18220 'copy in' README.os2 ext/GDBM_File/GDBM_File.pm ext/GDBM_File/Makefile.PL lib/Unicode/UCD.pm t/op/subst.t (@17645..) INSTALL t/op/grep.t (@18080..) ext/Fcntl/t/syslfs.t t/op/lfs.t (@18133..) 'merge in' t/op/eval.t (@17645..) pod/perldiag.pod (@18146..) lib/Unicode/UCD.t (@18156..) MANIFEST (@18173..)
Diffstat (limited to 't')
-rwxr-xr-xt/op/eval.t8
-rwxr-xr-xt/op/grep.t8
-rw-r--r--t/op/lfs.t6
-rwxr-xr-xt/op/subst.t11
4 files changed, 27 insertions, 6 deletions
diff --git a/t/op/eval.t b/t/op/eval.t
index 6487b9e8e4..79e219e97d 100755
--- a/t/op/eval.t
+++ b/t/op/eval.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..77\n";
+print "1..78\n";
eval 'print "ok 1\n";';
@@ -242,6 +242,12 @@ print $@;
eval q{};
print length($@) ? "not ok 46\t# \$\@ = '$@'\n" : "ok 46\n";
}
+# [perl #9728] used to dump core
+{
+ $eval = eval 'sub { eval "sub { %S }" }';
+ $eval->({});
+ print "ok 47\n";
+}
# DAPM Nov-2002. Perl should now capture the full lexical context during
# evals.
diff --git a/t/op/grep.t b/t/op/grep.t
index d4885277f8..6e608132fc 100755
--- a/t/op/grep.t
+++ b/t/op/grep.t
@@ -4,7 +4,7 @@
# grep() and map() tests
#
-print "1..32\n";
+print "1..33\n";
$test = 1;
@@ -128,4 +128,10 @@ sub ok {
print "# @x,$y\n";
print "@x,$y" eq "3 4,1212" ? "ok $test\n" : "not ok $test\n";
$test++;
+
+ # Add also a sample test from [perl #18153]. (The same bug).
+ $a = 1; map {if ($a){}} (2);
+ print "ok $test\n"; # no core dump is all we need
+ $test++;
}
+
diff --git a/t/op/lfs.t b/t/op/lfs.t
index e62cdbf900..f463b1b7b3 100644
--- a/t/op/lfs.t
+++ b/t/op/lfs.t
@@ -269,10 +269,10 @@ bye(); # does the necessary cleanup
END {
# unlink may fail if applied directly to a large file
- open(BIG, ">big");
- print BIG "x";
+ # be paranoid about leaving 5 gig files lying around
+ open(BIG, ">big"); # truncate
close(BIG);
- unlink "big"; # be paranoid about leaving 5 gig files lying around
+ 1 while unlink "big"; # standard portable idiom
}
# eof
diff --git a/t/op/subst.t b/t/op/subst.t
index 63fb6c62eb..ef0ae0a064 100755
--- a/t/op/subst.t
+++ b/t/op/subst.t
@@ -7,7 +7,7 @@ BEGIN {
}
require './test.pl';
-plan( tests => 122 );
+plan( tests => 124 );
$x = 'foo';
$_ = "x";
@@ -491,3 +491,12 @@ SKIP: {
is($b, "$na--$na--$nb", "s///: replace long non-utf8 into non-utf8 (utf8 pattern)");
}
+$_ = 'aaaa';
+$r = 'x';
+$s = s/a(?{})/$r/g;
+is("<$_> <$s>", "<xxxx> <4>", "perl #7806");
+
+$_ = 'aaaa';
+$s = s/a(?{})//g;
+is("<$_> <$s>", "<> <4>", "perl #7806");
+