From: Jarkko Hietaniemi Date: Fri, 8 Jun 2001 19:21:56 +0000 (+0000) Subject: More \p{In...} testing, combined with \N{...}. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a72deede5275fd576481e74da7ab7f9a7ef046ad;p=p5sagit%2Fp5-mst-13.2.git More \p{In...} testing, combined with \N{...}. p4raw-id: //depot/perl@10481 --- diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl index a843737..b73cea0 100644 --- a/lib/utf8_heavy.pl +++ b/lib/utf8_heavy.pl @@ -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#; diff --git a/t/op/pat.t b/t/op/pat.t index ab4226c..c59e31f 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -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"; +} +