X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/fa1639c581be6a27f090adf217f82a3e86ba3446..84bb2957796edcfae3987d615d1b8f0f6495a3cf:/t/re/subst.t diff --git a/t/re/subst.t b/t/re/subst.t index 73c7ac0..de6284a 100644 --- a/t/re/subst.t +++ b/t/re/subst.t @@ -7,7 +7,7 @@ BEGIN { } require './test.pl'; -plan( tests => 167 ); +plan( tests => 170 ); # Stolen from re/ReTest.pl. Can't just use the file since it doesn't support # like() and it conflicts with test.pl @@ -713,3 +713,14 @@ fresh_perl_is( '$_="abcef"; s/bc|(.)\G(.)/$1 ? "[$1-$2]" : "XX"/ge; print' => 'a is($non_sub_string, $string, "Verify that failed substitute doesn't change string"); } + +{ # Verify largish octal in replacement pattern + + my $string = "a"; + $string =~ s/a/\400/; + is($string, chr 0x100, "Verify that handles s/foo/\\400/"); + $string =~ s/./\600/; + is($string, chr 0x180, "Verify that handles s/foo/\\600/"); + $string =~ s/./\777/; + is($string, chr 0x1FF, "Verify that handles s/foo/\\777/"); +}