This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
APItest/t/utf8_warn_base.pl: Remove hash elements
[perl5.git] / ext / XS-APItest / t / utf8_warn_base.pl
index 68d60f6..d469038 100644 (file)
@@ -44,258 +44,258 @@ sub nonportable_regex ($) {
 # Now test the cases where a legal code point is generated, but may or may not
 # be allowed/warned on.
 my @tests = (
-     # ($testname, $bytes, $warn_flags, $disallow_flags, $expected_error_flags,
-     #  $category, $allowed_uv, $needed_to_discern_len )
+     # ($testname, $bytes, $disallow_flags, $category,
+     #  $allowed_uv, $needed_to_discern_len )
     [ "lowest surrogate",
         (isASCII) ? "\xed\xa0\x80" : I8_to_native("\xf1\xb6\xa0\xa0"),
-        $::UTF8_WARN_SURROGATE, $::UTF8_DISALLOW_SURROGATE, $::UTF8_GOT_SURROGATE,
+        $::UTF8_DISALLOW_SURROGATE,
         'surrogate', 0xD800,
         2,
     ],
     [ "a middle surrogate",
         (isASCII) ? "\xed\xa4\x8d" : I8_to_native("\xf1\xb6\xa8\xad"),
-        $::UTF8_WARN_SURROGATE, $::UTF8_DISALLOW_SURROGATE, $::UTF8_GOT_SURROGATE,
+        $::UTF8_DISALLOW_SURROGATE,
         'surrogate', 0xD90D,
         2,
     ],
     [ "highest surrogate",
         (isASCII) ? "\xed\xbf\xbf" : I8_to_native("\xf1\xb7\xbf\xbf"),
-        $::UTF8_WARN_SURROGATE, $::UTF8_DISALLOW_SURROGATE, $::UTF8_GOT_SURROGATE,
+        $::UTF8_DISALLOW_SURROGATE,
         'surrogate', 0xDFFF,
         2,
     ],
     [ "first non_unicode",
         (isASCII) ? "\xf4\x90\x80\x80" : I8_to_native("\xf9\xa2\xa0\xa0\xa0"),
-        $::UTF8_WARN_SUPER, $::UTF8_DISALLOW_SUPER, $::UTF8_GOT_SUPER,
+        $::UTF8_DISALLOW_SUPER,
         'non_unicode', 0x110000,
         2,
     ],
     [ "non_unicode whose first byte tells that",
         (isASCII) ? "\xf5\x80\x80\x80" : I8_to_native("\xfa\xa0\xa0\xa0\xa0"),
-        $::UTF8_WARN_SUPER, $::UTF8_DISALLOW_SUPER, $::UTF8_GOT_SUPER,
+        $::UTF8_DISALLOW_SUPER,
         'non_unicode',
         (isASCII) ? 0x140000 : 0x200000,
         1,
     ],
     [ "first of 32 consecutive non-character code points",
         (isASCII) ? "\xef\xb7\x90" : I8_to_native("\xf1\xbf\xae\xb0"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xFDD0,
         (isASCII) ? 3 : 4,
     ],
     [ "a mid non-character code point of the 32 consecutive ones",
         (isASCII) ? "\xef\xb7\xa0" : I8_to_native("\xf1\xbf\xaf\xa0"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xFDE0,
         (isASCII) ? 3 : 4,
     ],
     [ "final of 32 consecutive non-character code points",
         (isASCII) ? "\xef\xb7\xaf" : I8_to_native("\xf1\xbf\xaf\xaf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xFDEF,
         (isASCII) ? 3 : 4,
     ],
     [ "non-character code point U+FFFE",
         (isASCII) ? "\xef\xbf\xbe" : I8_to_native("\xf1\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xFFFE,
         (isASCII) ? 3 : 4,
     ],
     [ "non-character code point U+FFFF",
         (isASCII) ? "\xef\xbf\xbf" : I8_to_native("\xf1\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xFFFF,
         (isASCII) ? 3 : 4,
     ],
     [ "non-character code point U+1FFFE",
         (isASCII) ? "\xf0\x9f\xbf\xbe" : I8_to_native("\xf3\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x1FFFE,
         4,
     ],
     [ "non-character code point U+1FFFF",
         (isASCII) ? "\xf0\x9f\xbf\xbf" : I8_to_native("\xf3\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x1FFFF,
         4,
     ],
     [ "non-character code point U+2FFFE",
         (isASCII) ? "\xf0\xaf\xbf\xbe" : I8_to_native("\xf5\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x2FFFE,
         4,
     ],
     [ "non-character code point U+2FFFF",
         (isASCII) ? "\xf0\xaf\xbf\xbf" : I8_to_native("\xf5\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x2FFFF,
         4,
     ],
     [ "non-character code point U+3FFFE",
         (isASCII) ? "\xf0\xbf\xbf\xbe" : I8_to_native("\xf7\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x3FFFE,
         4,
     ],
     [ "non-character code point U+3FFFF",
         (isASCII) ? "\xf0\xbf\xbf\xbf" : I8_to_native("\xf7\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x3FFFF,
         4,
     ],
     [ "non-character code point U+4FFFE",
         (isASCII) ? "\xf1\x8f\xbf\xbe" : I8_to_native("\xf8\xa9\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x4FFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+4FFFF",
         (isASCII) ? "\xf1\x8f\xbf\xbf" : I8_to_native("\xf8\xa9\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x4FFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+5FFFE",
         (isASCII) ? "\xf1\x9f\xbf\xbe" : I8_to_native("\xf8\xab\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x5FFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+5FFFF",
         (isASCII) ? "\xf1\x9f\xbf\xbf" : I8_to_native("\xf8\xab\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x5FFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+6FFFE",
         (isASCII) ? "\xf1\xaf\xbf\xbe" : I8_to_native("\xf8\xad\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x6FFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+6FFFF",
         (isASCII) ? "\xf1\xaf\xbf\xbf" : I8_to_native("\xf8\xad\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x6FFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+7FFFE",
         (isASCII) ? "\xf1\xbf\xbf\xbe" : I8_to_native("\xf8\xaf\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x7FFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+7FFFF",
         (isASCII) ? "\xf1\xbf\xbf\xbf" : I8_to_native("\xf8\xaf\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x7FFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+8FFFE",
         (isASCII) ? "\xf2\x8f\xbf\xbe" : I8_to_native("\xf8\xb1\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x8FFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+8FFFF",
         (isASCII) ? "\xf2\x8f\xbf\xbf" : I8_to_native("\xf8\xb1\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x8FFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+9FFFE",
         (isASCII) ? "\xf2\x9f\xbf\xbe" : I8_to_native("\xf8\xb3\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x9FFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+9FFFF",
         (isASCII) ? "\xf2\x9f\xbf\xbf" : I8_to_native("\xf8\xb3\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x9FFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+AFFFE",
         (isASCII) ? "\xf2\xaf\xbf\xbe" : I8_to_native("\xf8\xb5\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xAFFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+AFFFF",
         (isASCII) ? "\xf2\xaf\xbf\xbf" : I8_to_native("\xf8\xb5\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xAFFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+BFFFE",
         (isASCII) ? "\xf2\xbf\xbf\xbe" : I8_to_native("\xf8\xb7\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xBFFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+BFFFF",
         (isASCII) ? "\xf2\xbf\xbf\xbf" : I8_to_native("\xf8\xb7\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xBFFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+CFFFE",
         (isASCII) ? "\xf3\x8f\xbf\xbe" : I8_to_native("\xf8\xb9\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xCFFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+CFFFF",
         (isASCII) ? "\xf3\x8f\xbf\xbf" : I8_to_native("\xf8\xb9\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xCFFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+DFFFE",
         (isASCII) ? "\xf3\x9f\xbf\xbe" : I8_to_native("\xf8\xbb\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xDFFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+DFFFF",
         (isASCII) ? "\xf3\x9f\xbf\xbf" : I8_to_native("\xf8\xbb\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xDFFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+EFFFE",
         (isASCII) ? "\xf3\xaf\xbf\xbe" : I8_to_native("\xf8\xbd\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xEFFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+EFFFF",
         (isASCII) ? "\xf3\xaf\xbf\xbf" : I8_to_native("\xf8\xbd\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xEFFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+FFFFE",
         (isASCII) ? "\xf3\xbf\xbf\xbe" : I8_to_native("\xf8\xbf\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xFFFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+FFFFF",
         (isASCII) ? "\xf3\xbf\xbf\xbf" : I8_to_native("\xf8\xbf\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0xFFFFF,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+10FFFE",
         (isASCII) ? "\xf4\x8f\xbf\xbe" : I8_to_native("\xf9\xa1\xbf\xbf\xbe"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x10FFFE,
         (isASCII) ? 4 : 5,
     ],
     [ "non-character code point U+10FFFF",
         (isASCII) ? "\xf4\x8f\xbf\xbf" : I8_to_native("\xf9\xa1\xbf\xbf\xbf"),
-        $::UTF8_WARN_NONCHAR, $::UTF8_DISALLOW_NONCHAR, $::UTF8_GOT_NONCHAR,
+        $::UTF8_DISALLOW_NONCHAR,
         'nonchar', 0x10FFFF,
         (isASCII) ? 4 : 5,
     ],
@@ -306,8 +306,7 @@ my @tests = (
             "\xff\xa0\xa0\xa0\xa0\xa0\xa0\xa2\xa0\xa0\xa0\xa0\xa0\xa0"),
         # This code point is chosen so that it is representable in a UV on
         # 32-bit machines
-        $::UTF8_WARN_ABOVE_31_BIT, $::UTF8_DISALLOW_ABOVE_31_BIT,
-        $::UTF8_GOT_ABOVE_31_BIT,
+        $::UTF8_DISALLOW_ABOVE_31_BIT,
         'utf8', 0x80000000,
         (isASCII) ? 1 : 8,
     ],
@@ -316,8 +315,7 @@ my @tests = (
          ?  "\xfe\x83\xbf\xbf\xbf\xbf\xbf"
          : I8_to_native(
             "\xff\xa0\xa0\xa0\xa0\xa0\xa0\xa3\xbf\xbf\xbf\xbf\xbf\xbf"),
-        $::UTF8_WARN_ABOVE_31_BIT, $::UTF8_DISALLOW_ABOVE_31_BIT,
-        $::UTF8_GOT_ABOVE_31_BIT,
+        $::UTF8_DISALLOW_ABOVE_31_BIT,
         'utf8', 0xFFFFFFFF,
         (isASCII) ? 1 : 8,
     ],
@@ -327,7 +325,7 @@ my @tests = (
          ? "\xfe\x82\x80\x80\x80\x80\x80"
          : I8_to_native(
            "\xff\xa0\xa0\xa0\xa0\xa0\xa0\xa2\xa0\xa0\xa0\xa0\xa0\xa0"),
-        $::UTF8_WARN_SUPER, $::UTF8_DISALLOW_SUPER, $::UTF8_GOT_SUPER,
+        $::UTF8_DISALLOW_SUPER,
         'utf8', 0x80000000,
         1,
     ],
@@ -349,9 +347,7 @@ my @tests = (
            ?    "\xfe\x86\x80\x80\x80\x80\x80"
            : I8_to_native(
                 "\xff\xa0\xa0\xa0\xa0\xa0\xa0\xa4\xa0\xa0\xa0\xa0\xa0\xa0"))),
-        $::UTF8_WARN_ABOVE_31_BIT,
         $::UTF8_DISALLOW_ABOVE_31_BIT,
-        $::UTF8_GOT_ABOVE_31_BIT,
         'utf8', -1,
         (isASCII || $::is64bit) ? 2 : 8,
     ],
@@ -363,8 +359,7 @@ if (! $::is64bit) {
         push @tests,
             [ "Lowest 33 bit code point: overflow",
                 "\xFE\x84\x80\x80\x80\x80\x80",
-                $::UTF8_WARN_ABOVE_31_BIT, $::UTF8_DISALLOW_ABOVE_31_BIT,
-                $::UTF8_GOT_ABOVE_31_BIT,
+                $::UTF8_DISALLOW_ABOVE_31_BIT,
                 'utf8', -1,
                 1,
             ];
@@ -378,8 +373,7 @@ else {
             ?       "\xff\x80\x80\x80\x80\x80\x81\x80\x80\x80\x80\x80\x80"
             : I8_to_native(
                     "\xff\xa0\xa0\xa0\xa0\xa0\xa2\xa0\xa0\xa0\xa0\xa0\xa0\xa0"),
-            $::UTF8_WARN_ABOVE_31_BIT, $::UTF8_DISALLOW_ABOVE_31_BIT,
-            $::UTF8_GOT_ABOVE_31_BIT,
+            $::UTF8_DISALLOW_ABOVE_31_BIT,
             'utf8', 0x1000000000,
             (isASCII) ? 1 : 7,
         ];
@@ -389,48 +383,42 @@ else {
             [ "requires at least 32 bits",
                 I8_to_native(
                     "\xff\xa0\xa0\xa0\xa0\xa0\xa1\xa0\xa0\xa0\xa0\xa0\xa0\xa0"),
-                $::UTF8_WARN_ABOVE_31_BIT,$::UTF8_DISALLOW_ABOVE_31_BIT,
-                $::UTF8_GOT_ABOVE_31_BIT,
+                $::UTF8_DISALLOW_ABOVE_31_BIT,
                 'utf8', 0x800000000,
                 7,
             ],
             [ "requires at least 32 bits",
                 I8_to_native(
                     "\xff\xa0\xa0\xa0\xa0\xa1\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0"),
-                $::UTF8_WARN_ABOVE_31_BIT,$::UTF8_DISALLOW_ABOVE_31_BIT,
-                $::UTF8_GOT_ABOVE_31_BIT,
+                $::UTF8_DISALLOW_ABOVE_31_BIT,
                 'utf8', 0x10000000000,
                 6,
             ],
             [ "requires at least 32 bits",
                 I8_to_native(
                     "\xff\xa0\xa0\xa0\xa1\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0"),
-                $::UTF8_WARN_ABOVE_31_BIT,$::UTF8_DISALLOW_ABOVE_31_BIT,
-                $::UTF8_GOT_ABOVE_31_BIT,
+                $::UTF8_DISALLOW_ABOVE_31_BIT,
                 'utf8', 0x200000000000,
                 5,
             ],
             [ "requires at least 32 bits",
                 I8_to_native(
                     "\xff\xa0\xa0\xa1\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0"),
-                $::UTF8_WARN_ABOVE_31_BIT,$::UTF8_DISALLOW_ABOVE_31_BIT,
-                $::UTF8_GOT_ABOVE_31_BIT,
+                $::UTF8_DISALLOW_ABOVE_31_BIT,
                 'utf8', 0x4000000000000,
                 4,
             ],
             [ "requires at least 32 bits",
                 I8_to_native(
                     "\xff\xa0\xa1\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0"),
-                $::UTF8_WARN_ABOVE_31_BIT,$::UTF8_DISALLOW_ABOVE_31_BIT,
-                $::UTF8_GOT_ABOVE_31_BIT,
+                $::UTF8_DISALLOW_ABOVE_31_BIT,
                 'utf8', 0x80000000000000,
                 3,
             ],
             [ "requires at least 32 bits",
                 I8_to_native(
                     "\xff\xa1\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0"),
-                $::UTF8_WARN_ABOVE_31_BIT,$::UTF8_DISALLOW_ABOVE_31_BIT,
-                $::UTF8_GOT_ABOVE_31_BIT,
+                $::UTF8_DISALLOW_ABOVE_31_BIT,
                 'utf8', 0x1000000000000000,
                 2,
             ];
@@ -446,13 +434,20 @@ foreach my $test (@tests) {
     $test_count++;
     next if $test_count % $num_test_files != $::TEST_CHUNK;
 
-    my ($testname, $bytes, $warn_flags, $disallow_flags, $expected_error_flags,
+    my ($testname, $bytes, $disallow_flags,
         $category, $allowed_uv, $needed_to_discern_len
        ) = @$test;
 
     my $length = length $bytes;
     my $will_overflow = $allowed_uv < 0;
 
+    # The convention is that the got flag is the same value as the disallow
+    # one, and the warn flag is the next bit over.  If this were violated, the
+    # tests here should start failing.  We could do an eval under no strict to
+    # be sure.
+    my $expected_error_flags = $disallow_flags;
+    my $warn_flags = $disallow_flags << 1;
+
     my $message;
     if ($allowed_uv > 0x7FFFFFFF) {
         $message = nonportable_regex($allowed_uv);