This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perluniprops: Add markup, like C<>
[perl5.git] / lib / charnames.t
index 4271b58..c5d2a8d 100644 (file)
@@ -249,6 +249,11 @@ is("\N{BOM}", chr(0xFEFF));
 
     ok(grep { /"HORIZONTAL TABULATION" is deprecated.*CHARACTER TABULATION/ } @WARN);
 
+    # XXX These tests should be changed for 5.16, when we convert BELL to the
+    # Unicode version.
+    is("\N{BELL}", "\a");
+    ok((grep{ /"BELL" is deprecated.*ALERT/ } @WARN), 'BELL is deprecated');
+
     no warnings 'deprecated';
 
     is("\N{VERTICAL TABULATION}", "\013");
@@ -656,7 +661,7 @@ is($_, 'foobar');
 
 # Unicode slowdown noted by Phil Pennock, traced to a bug fix in index
 # SADAHIRO Tomoyuki's suggestion is to ensure that the UTF-8ness of both
-# arguments are indentical before calling index.
+# arguments are identical before calling index.
 # To do this can take advantage of the fact that unicore/Name.pl is 7 bit
 # (or at least should be). So assert that that it's true here.  EBCDIC
 # may be a problem (khw).
@@ -914,6 +919,12 @@ is("\N{U+1D0C5}", "\N{BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA VASIS}");
         # marked <control>
         $name = $u1name if $name eq "<control>";
 
+        $name = 'ALERT' if $decimal == 7;
+
+        # XXX This test should be changed for 5.16 when we convert to use
+        # Unicode's BELL
+        $name = "" if $decimal == 0x1F514;
+
         # Some don't have names, leave those array elements undefined
         next unless $name;
 
@@ -1015,19 +1026,20 @@ is("\N{U+1D0C5}", "\N{BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA VASIS}");
         if ($test_count == 0) {
             $test_count = 1;
             if ($run_slow_tests < $RUN_SLOW_TESTS_EVERY_CODE_POINT) {
-            $end_block++;
-
-            # Keep coalescing until find a block that has something in
-            # it.  But don't cross plane boundaries (the 16 bits below),
-            # so there is at least one test for every plane.
-            while ($end_block < $block_count
-                   && $end_block >> (16 - $block_size_bits) == $block >> (16 - $block_size_bits)
-                   && ! $algorithmic_names_count[$end_block]
-                   && ! $regular_names_count[$end_block])
-            {
                 $end_block++;
-            }
-            $end_block--;   # Back-off to a block that has no defined names
+
+                # Keep coalescing until find a block that has something in
+                # it.  But don't cross plane boundaries (the 16 bits below),
+                # so there is at least one test for every plane.
+                while ($end_block < $block_count
+                       && $end_block >> (16 - $block_size_bits)
+                                        == $block >> (16 - $block_size_bits)
+                       && ! $algorithmic_names_count[$end_block]
+                       && ! $regular_names_count[$end_block])
+                {
+                    $end_block++;
+                }
+                $end_block--;   # Back-off to a block that has no defined names
             }
         }