X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fcharnames.t;h=d0139070cf01be08de9c7c2fe981a3cfcbad239c;hb=55f4245edad4e38b1869f0a6467a997a59257a0f;hp=49917c5ad68ce82c5c23c8390a8b85519d44bb02;hpb=e5c3f8982a1650ad4c25a05c41a9038ce21a512c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/charnames.t b/lib/charnames.t index 49917c5..d013907 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -15,7 +15,7 @@ require File::Spec; $| = 1; -print "1..74\n"; +print "1..78\n"; use charnames ':full'; @@ -61,7 +61,7 @@ else { # EBCDIC where UTF-EBCDIC may be used (this may be 1047 specific since } sub to_bytes { - pack"a*", shift; + unpack"U0a*", shift; } { @@ -334,6 +334,31 @@ 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"; +} + +# Verify that charnames propagate to eval("") +my $evaltry = eval q[ "Eval: \N{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}" ]; +if ($@) { + print "# $@not ok 77\nnot ok 78\n"; +} else { + print "ok 77\n"; + print "not " unless $evaltry eq "Eval: \N{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}"; + print "ok 78\n"; +} + __END__ # unsupported pragma use charnames ":scoobydoo";