This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ext/B/t/b.t: Generalize for non-ASCII platforms
authorKarl Williamson <public@khwilliamson.com>
Tue, 16 Apr 2013 18:13:07 +0000 (12:13 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 6 Mar 2015 04:48:26 +0000 (21:48 -0700)
ext/B/t/b.t

index 93d8867..d9d9e7b 100644 (file)
@@ -280,7 +280,7 @@ is(B::opnumber("pp_null"), 0, "Testing opnumber with opname (pp_null)");
     while (my ($test, $expect) = splice @tests, 0, 2) {
        is(B::perlstring($test), $expect, "B::perlstring($expect)");
        utf8::upgrade $test;
-       $expect =~ s/\\b/\\x\{8\}/g;
+       $expect =~ s/\\b/sprintf("\\x{%x}", utf8::unicode_to_native(8))/eg;
        $expect =~ s/\\([0-7]{3})/sprintf "\\x\{%x\}", oct $1/eg;
        is(B::perlstring($test), $expect, "B::perlstring($expect) (Unicode)");
     }