Commit | Line | Data |
423cee85 |
1 | #!./perl |
2 | |
3 | BEGIN { |
4 | unless(grep /blib/, @INC) { |
5 | chdir 't' if -d 't'; |
6 | unshift @INC, '../lib' if -d '../lib'; |
7 | } |
8 | } |
9 | |
10 | $| = 1; |
11 | print "1..5\n"; |
12 | |
13 | use charnames ':full'; |
14 | |
4a2d328f |
15 | print "not " unless "Here\N{EXCLAMATION MARK}?" eq 'Here!?'; |
423cee85 |
16 | print "ok 1\n"; |
17 | |
18 | print "# \$res=$res \$\@='$@'\nnot " |
19 | if $res = eval <<'EOE' |
20 | use charnames ":full"; |
4a2d328f |
21 | "Here: \N{CYRILLIC SMALL LETTER BE}!"; |
423cee85 |
22 | 1 |
23 | EOE |
24 | or $@ !~ /above 0xFF/; |
25 | print "ok 2\n"; |
26 | # print "# \$res=$res \$\@='$@'\n"; |
27 | |
28 | print "# \$res=$res \$\@='$@'\nnot " |
29 | if $res = eval <<'EOE' |
30 | use charnames 'cyrillic'; |
4a2d328f |
31 | "Here: \N{Be}!"; |
423cee85 |
32 | 1 |
33 | EOE |
34 | or $@ !~ /CYRILLIC CAPITAL LETTER BE.*above 0xFF/; |
35 | print "ok 3\n"; |
36 | |
37 | # If octal representation of unicode char is \0xyzt, then the utf8 is \3xy\2zt |
38 | $encoded_be = "\320\261"; |
39 | $encoded_alpha = "\316\261"; |
40 | $encoded_bet = "\327\221"; |
41 | { |
42 | use charnames ':full'; |
43 | use utf8; |
44 | |
4a2d328f |
45 | print "not " unless "\N{CYRILLIC SMALL LETTER BE}" eq $encoded_be; |
423cee85 |
46 | print "ok 4\n"; |
47 | |
48 | use charnames qw(cyrillic greek :short); |
49 | |
4a2d328f |
50 | print "not " unless "\N{be},\N{alpha},\N{hebrew:bet}" |
423cee85 |
51 | eq "$encoded_be,$encoded_alpha,$encoded_bet"; |
52 | print "ok 5\n"; |
53 | } |