This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
charnames.t: Add tests for NameAliases
authorKarl Williamson <public@khwilliamson.com>
Sat, 11 Sep 2010 19:10:37 +0000 (13:10 -0600)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 25 Sep 2010 07:47:01 +0000 (00:47 -0700)
lib/charnames.t

index d909824..11fe818 100644 (file)
@@ -885,6 +885,16 @@ is("\N{U+1D0C5}", "\N{BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA VASIS}");
         $algorithmic_names_count[$block] = 1;
     }
 
+    open $fh, "<", "../../lib/unicore/NameAliases.txt" or
+        die "Can't open ../../lib/unicore/NameAliases.txt: $!";
+    while (<$fh>) {
+        chomp;
+        s/^\s*#.*//;
+        next unless $_;
+        my ($hex, $name) = split ";";
+        is(charnames::vianame($name), hex $hex, "Verify vianame(\"$name\") is 0x$hex");
+    }
+    close $fh;
 
     # Now, have all the names populated.  Do the tests