diff options
author | SADAHIRO Tomoyuki <BQW10602@nifty.com> | 2006-05-15 04:57:28 +0900 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-05-15 08:33:53 +0000 |
commit | 4c5ed6e2fe45844ca952edb0ad5be618e204247b (patch) | |
tree | 13f79404b1e916a7fc9aed964369c986ece9d08d /t/uni | |
parent | 9c8d215a6f7e1098759dbf707ed95f4895bc227c (diff) | |
download | perl-4c5ed6e2fe45844ca952edb0ad5be618e204247b.tar.gz |
strange encodings upsets pp_chr
Message-Id: <20060514195532.5422.BQW10602@nifty.com>
p4raw-id: //depot/perl@28193
Diffstat (limited to 't/uni')
-rw-r--r-- | t/uni/chr.t | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/t/uni/chr.t b/t/uni/chr.t new file mode 100644 index 0000000000..ab710d9e35 --- /dev/null +++ b/t/uni/chr.t @@ -0,0 +1,41 @@ + +BEGIN { + if ($ENV{'PERL_CORE'}){ + chdir 't'; + @INC = '../lib'; + } + require Config; import Config; + if ($Config{'extensions'} !~ /\bEncode\b/) { + print "1..0 # Skip: Encode was not built\n"; + exit 0; + } + if (ord("A") == 193) { + print "1..0 # Skip: EBCDIC\n"; + exit 0; + } + unless (PerlIO::Layer->find('perlio')){ + print "1..0 # Skip: PerlIO required\n"; + exit 0; + } + if ($ENV{PERL_CORE_MINITEST}) { + print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n"; + exit 0; + } + $| = 1; +} + +use strict; +use Test::More tests => 6; +use Encode; + +use encoding 'johab'; + +ok(chr(0x7f) eq "\x7f"); +ok(chr(0x80) eq "\x80"); +ok(chr(0xff) eq "\xff"); + +for my $i (127, 128, 255) { + ok(chr($i) eq pack('C', $i)); +} + +__END__ |