Standardise t/uni/*.t on ./test.pl, and remove PERL_CORE boilerplate.
[p5sagit/p5-mst-13.2.git] / t / uni / chr.t
1 #!./perl -w
2
3 BEGIN {
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;
22
23     require './test.pl';
24 }
25
26 use strict;
27 plan (tests => 6);
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__