In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/1e629c2290cf7b0cfc69d56f21dbb4c53f60127d?hp=3072e7590c6345bcdd3e68ceb789160139beb412>

- Log -----------------------------------------------------------------
commit 1e629c2290cf7b0cfc69d56f21dbb4c53f60127d
Author: Karl Williamson <[email protected]>
Date:   Mon Jul 10 20:11:09 2017 -0600

    t/re/pat_advanced.t: Fix test to work on EBCDIC

M       t/re/pat_advanced.t

commit ceea523d49f14d4a20af3d440da95e5cfad000d2
Author: Karl Williamson <[email protected]>
Date:   Mon Jul 10 20:09:25 2017 -0600

    t/op/sprintf2.t: Generalize test to work on EBCDIC

M       t/op/sprintf2.t
-----------------------------------------------------------------------

Summary of changes:
 t/op/sprintf2.t     | 10 ++++++++--
 t/re/pat_advanced.t |  4 +++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/t/op/sprintf2.t b/t/op/sprintf2.t
index 357be7240d..6d32004a9d 100644
--- a/t/op/sprintf2.t
+++ b/t/op/sprintf2.t
@@ -5,6 +5,7 @@
 BEGIN {
     chdir 't' if -d 't';
     require './test.pl';
+    require './charset_tools.pl';
     set_up_inc('../lib');
 }   
 
@@ -957,8 +958,13 @@ SKIP: {
     };
 
     use warnings;
-    my $s = sprintf "%s%\xc4\x80%s", "\x{102}", "\xc4\x83";
-    is($s, "\x{102}%\xc4\x80\xc4\x83", "utf8 for invalid format");
+    my $cap_A_macron_utf8 = byte_utf8a_to_utf8n("\xc4\x80");
+    my $small_a_breve_utf8 = byte_utf8a_to_utf8n("\xc4\x83");
+    my $s = sprintf "%s%$cap_A_macron_utf8%s",
+                    "\x{102}",
+                    $small_a_breve_utf8;
+    is($s, "\x{102}%$cap_A_macron_utf8$small_a_breve_utf8",
+       "utf8 for invalid format");
     is($w_inv,   1, "utf8 for invalid format: invalid warnings");
     is($w_red,   0, "utf8 for invalid format: redundant warnings");
     is($w_other, 0, "utf8 for invalid format: other warnings");
diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t
index a2ff68169b..3d57beade4 100644
--- a/t/re/pat_advanced.t
+++ b/t/re/pat_advanced.t
@@ -945,7 +945,9 @@ sub run_tests {
                     'Empty string charname produces NOTHING node';
         like "\N{LONG-STR}", qr/^\N{LONG-STR}$/, 'Verify that long string 
works';
         like "\N{LONG-STR}", qr/^\N{LONG-STR}$/i, 'Verify under folding that 
long string works';
-        like "\xc4", qr/\N{EMPTY-STR}\xe4/i, 'Empty \N{} should change /d to 
/u';
+
+        # perlhacktips points out that these work on both ASCII and EBCDIC
+        like "\xfc", qr/\N{EMPTY-STR}\xdc/i, 'Empty \N{} should change /d to 
/u';
 
         eval '/(?[[\N{EMPTY-STR}]])/';
         like $@, qr/Zero length \\N\{\}/, 'Verify zero-length return from \N{} 
correctly fails';

--
Perl5 Master Repository

Reply via email to