This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
skip t/op/incfilter.t for "make clean;make miniperl;make minitest"
[perl5.git] / t / uni / chr.t
CommitLineData
4c5ed6e2
TS
1
2BEGIN {
3 if ($ENV{'PERL_CORE'}){
4 chdir 't';
5 @INC = '../lib';
6 }
7 require Config; import Config;
8 if ($Config{'extensions'} !~ /\bEncode\b/) {
9 print "1..0 # Skip: Encode was not built\n";
10 exit 0;
11 }
12 if (ord("A") == 193) {
13 print "1..0 # Skip: EBCDIC\n";
14 exit 0;
15 }
16 unless (PerlIO::Layer->find('perlio')){
17 print "1..0 # Skip: PerlIO required\n";
18 exit 0;
19 }
20 if ($ENV{PERL_CORE_MINITEST}) {
21 print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n";
22 exit 0;
23 }
24 $| = 1;
25}
26
27use strict;
28use Test::More tests => 6;
29use Encode;
30
31use encoding 'johab';
32
33ok(chr(0x7f) eq "\x7f");
34ok(chr(0x80) eq "\x80");
35ok(chr(0xff) eq "\xff");
36
37for my $i (127, 128, 255) {
38 ok(chr($i) eq pack('C', $i));
39}
40
41__END__