Re: Analysis of problems with mixed encoding case insensitive matches in regex engine.
[p5sagit/p5-mst-13.2.git] / t / op / chop.t
index a77ff30..503f6f7 100755 (executable)
@@ -6,7 +6,7 @@ BEGIN {
     require './test.pl';
 }
 
-plan tests => 137;
+plan tests => 139;
 
 $_ = 'abc';
 $c = do foo();
@@ -183,7 +183,7 @@ ok($@ =~ /Can\'t modify.*chop.*in.*assignment/);
 eval 'chomp($x, $y) = (1, 2);';
 ok($@ =~ /Can\'t modify.*chom?p.*in.*assignment/);
 
-my @chars = ("N", "\xd3", substr ("\xd4\x{100}", 0, 1), chr 1296);
+my @chars = ("N", ord('A') == 193 ? "\xee" : "\xd3", substr ("\xd4\x{100}", 0, 1), chr 1296);
 foreach my $start (@chars) {
   foreach my $end (@chars) {
     local $/ = $end;
@@ -232,3 +232,14 @@ foreach my $start (@chars) {
     is($asc, "perl", "chopped ascii NUL");
     is($utf, "perl", "chopped utf8 NUL");
 }
+
+{
+    # Change 26011: Re: A surprising segfault
+    # to make sure only that these obfuscated sentences will not crash.
+
+    map chop(+()), ('')x68;
+    ok(1, "extend sp in pp_chop");
+
+    map chomp(+()), ('')x68;
+    ok(1, "extend sp in pp_chomp");
+}