This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Slight reorg of the binmode() entry.
[perl5.git] / lib / bytes.t
CommitLineData
4e002eb0
JH
1BEGIN {
2 chdir 't' if -d 't';
3 @INC = '../lib';
4}
5
6print "1..6\n";
7
8my $a = chr(0x0100);
9
10print ord($a) == 0x100 ? "ok 1\n" : "not ok 1\n";
11print length($a) == 1 ? "ok 2\n" : "not ok 2\n";
12
13{
14 use bytes;
15 my $b = chr(0x0100);
16 print ord($b) == 0 ? "ok 3\n" : "not ok 3\n";
17}
18
19my $c = chr(0x0100);
20
21print ord($c) == 0x100 ? "ok 4\n" : "not ok 4\n";
22
23{
24 use bytes;
0ef00eb6
JH
25 if (ord('A') == 193) {
26 print ord($c) == 0x8c ? "ok 5\n" : "not ok 5\n";
27 } else {
28 print ord($c) == 0xc4 ? "ok 5\n" : "not ok 5\n";
29 }
4e002eb0
JH
30 print length($c) == 2 ? "ok 6\n" : "not ok 6\n";
31}
32