This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_repeat: handle large source strings for scalar repeat
[perl5.git] / t / bigmem / str.t
index eb4cd19..34d2eac 100644 (file)
@@ -9,8 +9,8 @@ use Config qw(%Config);
 
 # 2G each for the $p2g, $n2g and $t
 
-$ENV{PERL_TEST_MEMORY} >= 7
-    or skip_all("Need ~7Gb for this test");
+$ENV{PERL_TEST_MEMORY} >= 11
+    or skip_all("Need ~11Gb for this test");
 $Config{ptrsize} >= 8
     or skip_all("Need 64-bit pointers for this test");
 
@@ -23,7 +23,16 @@ my $p2g = ($p x $sz);
 
 is(length $p2g, $sz, "check p2g size");
 
-my $t = ~$p2g;
+my $t = ($p x $sz);
+ok($t eq $p2g, "check scalar repeat with large count");
+undef $t;
+my $two = 2; # no constant folding
+
+$t = ($p2g x $two);
+ok($t eq "$p2g$p2g", "check scalar repeat with large source");
+undef $t;
+
+$t = ~$p2g;
 my $n2g = ($n x $sz);
 
 is(length $n2g, $sz, "check p2g size");