Re: any takers for this Storable bug?
[p5sagit/p5-mst-13.2.git] / t / op / readline.t
index 8936022..d127d58 100644 (file)
@@ -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