This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
XS-APItest/t/utf8.t: Fix failing EBCDIC test
authorKarl Williamson <khw@cpan.org>
Wed, 5 Oct 2016 20:56:59 +0000 (14:56 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 5 Oct 2016 22:22:10 +0000 (16:22 -0600)
Recent commit 418080dc73a4b9e525a76d6d3b5034ff616716b4 fixing a test in
this file that was failing only on EBCDIC platforms had an error.  It
applied a correction to a test that didn't require it, causing it to
fail.  This commit changes that to use a different method to detect
which tests to apply the correction to, and knowing that some things can
be determined earlier as a result.

ext/XS-APItest/t/utf8.t

index 2061232..32f60e0 100644 (file)
@@ -1818,7 +1818,11 @@ foreach my $test (@tests) {
                             $comment .= ", but need 2 bytes to discern";
                         }
                     }
-                    elsif ($testname =~ /first non_unicode/ && $j < 2) {
+                    elsif (   ($disallow_flags & $UTF8_DISALLOW_SUPER)
+                           && $j < 2
+                           && ord(native_to_I8(substr($bytes, 0, 1)))
+                               lt ((isASCII) ? 0xF5 : 0xFA))
+                    {
                         $ret_should_be = 1;
                         $comment .= ", but need 2 bytes to discern";
                     }