1#!./perl
2
3BEGIN {
4    chdir 't' if -d 't';
5    require './test.pl';
6    set_up_inc('../lib');
7}
8
9plan tests => 34;
10
11# because of ebcdic.c these should be the same on asciiish
12# and ebcdic machines.
13# Peter Prymmer <pvhp@best.com>.
14
15my $c = "\c@";
16is (ord($c), 0, '\c@');
17$c = "\cA";
18is (ord($c), 1, '\cA');
19$c = "\cB";
20is (ord($c), 2, '\cB');
21$c = "\cC";
22is (ord($c), 3, '\cC');
23$c = "\cD";
24is (ord($c), 4, '\cD');
25$c = "\cE";
26is (ord($c), 5, '\cE');
27$c = "\cF";
28is (ord($c), 6, '\cF');
29$c = "\cG";
30is (ord($c), 7, '\cG');
31$c = "\cH";
32is (ord($c), 8, '\cH');
33$c = "\cI";
34is (ord($c), 9, '\cI');
35$c = "\cJ";
36is (ord($c), 10, '\cJ');
37$c = "\cK";
38is (ord($c), 11, '\cK');
39$c = "\cL";
40is (ord($c), 12, '\cL');
41$c = "\cM";
42is (ord($c), 13, '\cM');
43$c = "\cN";
44is (ord($c), 14, '\cN');
45$c = "\cO";
46is (ord($c), 15, '\cO');
47$c = "\cP";
48is (ord($c), 16, '\cP');
49$c = "\cQ";
50is (ord($c), 17, '\cQ');
51$c = "\cR";
52is (ord($c), 18, '\cR');
53$c = "\cS";
54is (ord($c), 19, '\cS');
55$c = "\cT";
56is (ord($c), 20, '\cT');
57$c = "\cU";
58is (ord($c), 21, '\cU');
59$c = "\cV";
60is (ord($c), 22, '\cV');
61$c = "\cW";
62is (ord($c), 23, '\cW');
63$c = "\cX";
64is (ord($c), 24, '\cX');
65$c = "\cY";
66is (ord($c), 25, '\cY');
67$c = "\cZ";
68is (ord($c), 26, '\cZ');
69$c = "\c[";
70is (ord($c), 27, '\c[');
71$c = "\c\\";
72is (ord($c), 28, '\c\\');
73$c = "\c]";
74is (ord($c), 29, '\c]');
75$c = "\c^";
76is (ord($c), 30, '\c^');
77$c = "\c_";
78is (ord($c), 31, '\c_');
79
80# '\c?' is an outlier, and is treated differently on each platform.
81# It's DEL on ASCII, and APC on EBCDIC
82$c = "\c?";
83is (ord($c), ($::IS_ASCII)
84             ? 127
85             : utf8::unicode_to_native(0x9F),
86              '\c?');
87$c = '';
88is (ord($c), 0, 'ord("") is 0');
89