More \p{In...} testing, combined with \N{...}.
authorJarkko Hietaniemi <jhi@iki.fi>
Fri, 8 Jun 2001 19:21:56 +0000 (19:21 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 8 Jun 2001 19:21:56 +0000 (19:21 +0000)
p4raw-id: //depot/perl@10481

lib/utf8_heavy.pl
t/op/pat.t

index a843737..b73cea0 100644 (file)
@@ -27,9 +27,10 @@ sub SWASHNEW {
     my $encoding = $enc{$caller} || "unicode";
     (my $file = $type) =~ s!::!/!g;
     if ($file =~ /^In(.+)/) {
+       my $In = $1;
        defined %utf8::In || do "$encoding/In.pl";
-       if (exists $utf8::In{$1}) {
-           $file = "$enconding/In/$utf8::In{$1}";
+       if (exists $utf8::In{$In}) {
+           $file = "$encoding/In/$utf8::In{$In}";
        }
     } else {
        $file =~ s#^(Is|To)([A-Z].*)#$1/$2#;
index ab4226c..c59e31f 100755 (executable)
@@ -6,7 +6,7 @@
 
 $| = 1;
 
-print "1..625\n";
+print "1..630\n";
 
 BEGIN {
     chdir 't' if -d 't';
@@ -1743,3 +1743,25 @@ EOT
     print "not " if $w !~ /^Useless \(\?o\).*\nUseless \(\?g\).*\nUseless \(\?c\)/;
     print "ok 625\n";
 }
+
+# More Unicode "class" tests
+
+{
+    use charnames ':full';
+
+    print "not " unless "\N{LATIN CAPITAL LETTER A}" =~ /\p{InBasicLatin}/;
+    print "ok 626\n";
+
+    print "not " unless "\N{LATIN CAPITAL LETTER A WITH GRAVE}" =~ /\p{InLatin1Supplement}/;
+    print "ok 627\n";
+
+    print "not " unless "\N{LATIN CAPITAL LETTER A WITH MACRON}" =~ /\p{InLatinExtendedA}/;
+    print "ok 628\n";
+
+    print "not " unless "\N{LATIN SMALL LETTER B WITH STROKE}" =~ /\p{InLatinExtendedB}/;
+    print "ok 629\n";
+
+    print "not " unless "\N{KATAKANA LETTER SMALL A}" =~ /\p{InKatakana}/;
+    print "ok 630\n";
+}
+