diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-02-04 22:13:08 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-02-04 22:13:08 +0000 |
commit | c776535e348e455bd9563b0f236d485a934456e7 (patch) | |
tree | 9255e098022896f739a23b64e107596f41f17f09 /lib | |
parent | 7cb608b5fc09aa914d5f91646e40ed772b6bac01 (diff) | |
download | perl-c776535e348e455bd9563b0f236d485a934456e7.tar.gz |
Add regression tests to lib/charnames.t to ensure that unicore/Names.pl
is 100% 7 bit ASCII.
p4raw-id: //depot/perl@27085
Diffstat (limited to 'lib')
-rw-r--r-- | lib/charnames.t | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/charnames.t b/lib/charnames.t index c53f54a067..efb66082b6 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -15,7 +15,7 @@ require File::Spec; $| = 1; -print "1..74\n"; +print "1..76\n"; use charnames ':full'; @@ -334,6 +334,22 @@ eval "use charnames ':full';"; print "not " unless $_ eq 'foobar'; print "ok 74\n"; +# 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. +# 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. + +my $names = do "unicore/Name.pl"; +print defined $names ? "ok 75\n" : "not ok 75\n"; +if (ord('A') == 65) { # as on ASCII or UTF-8 machines + my $non_ascii = $names =~ tr/\0-\177//c; + print $non_ascii ? "not ok 76 # $non_ascii\n" : "ok 76\n"; +} else { + print "ok 76\n"; +} + + __END__ # unsupported pragma use charnames ":scoobydoo"; |