This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/op/split.t: EBCDIC fixes
authorKarl Williamson <public@khwilliamson.com>
Tue, 2 Apr 2013 03:08:20 +0000 (21:08 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 6 Mar 2015 04:48:25 +0000 (21:48 -0700)
t/op/split.t

index 5d5c19d..50579bf 100644 (file)
@@ -375,7 +375,7 @@ is($cnt, scalar(@ary));
 
 {
     # LATIN SMALL LETTER A WITH DIAERESIS, CYRILLIC SMALL LETTER I
-    for my $pattern ("\x{e4}", "\x{0437}") {
+    for my $pattern ("\N{U+E4}", "\x{0437}") {
         utf8::upgrade $pattern;
         my @res;
         for my $str ("a${pattern}b", "axb", "a${pattern}b") {
@@ -492,14 +492,16 @@ is($cnt, scalar(@ary));
     my @results;
     my $expr;
     $expr = ' a b c ';
-    @results = split "\x20", $expr;
+    @results = split "\x20", $expr if $::IS_ASCII;
+    @results = split "\x40", $expr if $::IS_EBCDIC;
     is @results, 3,
         "RT #116086: split on string of single hex-20: captured 3 elements";
     is $results[0], 'a',
         "RT #116086: split on string of single hex-20: first element is non-empty";
 
     $expr = " a \tb c ";
-    @results = split "\x20", $expr;
+    @results = split "\x20", $expr if $::IS_ASCII;
+    @results = split "\x40", $expr if $::IS_EBCDIC;
     is @results, 3,
         "RT #116086: split on string of single hex-20: captured 3 elements";
     is $results[0], 'a',