Commit | Line | Data |
e4206093 |
1 | #!./perl -w |
4c5ed6e2 |
2 | |
3 | BEGIN { |
4c5ed6e2 |
4 | require Config; import Config; |
5 | if ($Config{'extensions'} !~ /\bEncode\b/) { |
6 | print "1..0 # Skip: Encode was not built\n"; |
7 | exit 0; |
8 | } |
9 | if (ord("A") == 193) { |
10 | print "1..0 # Skip: EBCDIC\n"; |
11 | exit 0; |
12 | } |
13 | unless (PerlIO::Layer->find('perlio')){ |
14 | print "1..0 # Skip: PerlIO required\n"; |
15 | exit 0; |
16 | } |
17 | if ($ENV{PERL_CORE_MINITEST}) { |
18 | print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n"; |
19 | exit 0; |
20 | } |
21 | $| = 1; |
e4206093 |
22 | |
23 | require './test.pl'; |
4c5ed6e2 |
24 | } |
25 | |
26 | use strict; |
e4206093 |
27 | plan (tests => 6); |
4c5ed6e2 |
28 | use encoding 'johab'; |
29 | |
30 | ok(chr(0x7f) eq "\x7f"); |
31 | ok(chr(0x80) eq "\x80"); |
32 | ok(chr(0xff) eq "\xff"); |
33 | |
34 | for my $i (127, 128, 255) { |
35 | ok(chr($i) eq pack('C', $i)); |
36 | } |
37 | |
38 | __END__ |