Commit | Line | Data |
d7fcd4ce |
1 | |
2 | # Time-stamp: "2004-04-27 19:53:22 ADT" |
3 | |
4 | use strict; |
5 | use Test; |
6 | |
7 | my @them; |
8 | BEGIN { plan('tests' => 41) }; |
9 | BEGIN { print "# Perl version $] under $^O\n" } |
10 | |
11 | use Pod::Escapes qw(:ALL); |
12 | ok 1; |
13 | |
14 | eval " binmode(STDOUT, ':utf8') "; |
15 | |
16 | print "# Pod::Escapes version $Pod::Escapes::VERSION\n"; |
17 | print "# I'm ", (chr(65) eq 'A') ? '' : 'not ', "in ASCII world.\n"; |
18 | print "#\n#------------------------\n#\n"; |
19 | |
20 | print "# 'A' tests...\n"; |
21 | ok e2charnum('65'), '65'; |
22 | ok e2charnum('x41'), '65'; |
23 | ok e2charnum('x041'), '65'; |
24 | ok e2charnum('x0041'), '65'; |
25 | ok e2charnum('x00041'), '65'; |
26 | ok e2charnum('0101'), '65'; |
27 | ok e2charnum('00101'), '65'; |
28 | ok e2charnum('000101'), '65'; |
29 | ok e2charnum('0000101'), '65'; |
30 | |
31 | print "# '<' tests...\n"; |
32 | ok e2charnum('lt'), '60'; |
33 | ok e2charnum('60'), '60'; |
34 | ok e2charnum('074'), '60'; |
35 | ok e2charnum('0074'), '60'; |
36 | ok e2charnum('00074'), '60'; |
37 | ok e2charnum('000074'), '60'; |
38 | ok e2charnum('x3c'), '60'; |
39 | ok e2charnum('x3C'), '60'; |
40 | ok e2charnum('x03c'), '60'; |
41 | ok e2charnum('x003c'), '60'; |
42 | ok e2charnum('x0003c'), '60'; |
43 | ok e2charnum('x00003c'), '60'; |
44 | |
45 | ok e2charnum('65') ne e2charnum('lt'); |
46 | |
47 | print "# eacute tests...\n"; |
48 | ok defined e2charnum('eacute'); |
49 | |
50 | print "# eacute is <", e2charnum('eacute'), "> which is code ", |
51 | ord(e2charnum('eacute')), "\n"; |
52 | |
53 | ok e2charnum('eacute'), e2charnum('233'); |
54 | ok e2charnum('eacute'), e2charnum('0351'); |
55 | ok e2charnum('eacute'), e2charnum('xe9'); |
56 | ok e2charnum('eacute'), e2charnum('xE9'); |
57 | |
58 | print "# pi tests...\n"; |
59 | ok defined e2charnum('pi'); |
60 | |
61 | print "# pi is <", e2charnum('pi'), "> which is code ", |
62 | e2charnum('pi'), "\n"; |
63 | |
64 | ok e2charnum('pi'), e2charnum('960'); |
65 | ok e2charnum('pi'), e2charnum('01700'); |
66 | ok e2charnum('pi'), e2charnum('001700'); |
67 | ok e2charnum('pi'), e2charnum('0001700'); |
68 | ok e2charnum('pi'), e2charnum('x3c0'); |
69 | ok e2charnum('pi'), e2charnum('x3C0'); |
70 | ok e2charnum('pi'), e2charnum('x03C0'); |
71 | ok e2charnum('pi'), e2charnum('x003C0'); |
72 | ok e2charnum('pi'), e2charnum('x0003C0'); |
73 | |
74 | |
75 | print "# %Name2character_number test...\n"; |
76 | |
77 | ok scalar keys %Name2character_number; |
78 | ok defined $Name2character_number{'eacute'}; |
79 | ok $Name2character_number{'lt'} eq '60'; |
80 | |
81 | # End |