summaryrefslogtreecommitdiff
path: root/t/op/readline.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2003-03-26 23:01:46 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-03-26 22:08:16 +0000
commitbc44a8a2ef6444a7379feaa886439b1a4b82d7b2 (patch)
tree6204eb2f6cba9d02a1cd6cc545043b5fa7ea0aac /t/op/readline.t
parent46ff39aa3cae6c7727297dc4bbc5eda0da9c5616 (diff)
downloadperl-bc44a8a2ef6444a7379feaa886439b1a4b82d7b2.tar.gz
Better version of change #19069
Subject: [PATCH] Re: [PATCH] Re: [perl #21614] 5.8.0 Unbalanced string table refcount Message-ID: <20030326230145.GC279@Bagpuss.unfortu.net> p4raw-link: @19069 on //depot/perl: 10bcdfd6e8d70ea5a2c02616001cf97fce7f3e17 p4raw-id: //depot/perl@19071
Diffstat (limited to 't/op/readline.t')
-rw-r--r--t/op/readline.t33
1 files changed, 32 insertions, 1 deletions
diff --git a/t/op/readline.t b/t/op/readline.t
index 8936022b2e..d127d583a5 100644
--- a/t/op/readline.t
+++ b/t/op/readline.t
@@ -6,7 +6,7 @@ BEGIN {
require './test.pl';
}
-plan tests => 5;
+plan tests => 11;
eval { for (\2) { $_ = <FH> } };
like($@, 'Modification of a read-only value attempted', '[perl #19566]');
@@ -27,3 +27,34 @@ foreach my $k ('k', 'k'x82) {
);
is ($result, "end", '[perl #21614] for length ' . length $k);
}
+
+
+foreach my $k ('perl', 'perl'x21) {
+ my $result
+ = runperl (switches => '-l', stdin => ' rules', stderr => 1,
+ prog => "%a = qw($k v); foreach (keys %a) {\$_ .= <>; print}",
+ );
+ is ($result, "$k rules", 'rcatline to shared sv for length ' . length $k);
+}
+
+foreach my $l (1, 82) {
+ my $k = $l;
+ $k = 'k' x $k;
+ my $copy = $k;
+ $k = <DATA>;
+ is ($k, "moo\n", 'catline to COW sv for length ' . length $copy);
+}
+
+
+foreach my $l (1, 21) {
+ my $k = $l;
+ $k = 'perl' x $k;
+ my $perl = $k;
+ $k .= <DATA>;
+ is ($k, "$perl rules\n", 'rcatline to COW sv for length ' . length $perl);
+}
+__DATA__
+moo
+moo
+ rules
+ rules