summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-01-01 23:05:48 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-01-01 23:05:48 +0000
commit7525822f4bebb9c40c200c1d927c4138e453e8b6 (patch)
tree5d02c1fb547fdf7b691e1bbc95016da2a2304c8b /t
parent062365604b359a1490884f0ddc7e02f237691b4d (diff)
downloadperl-7525822f4bebb9c40c200c1d927c4138e453e8b6.tar.gz
Integrate perlio:
[ 8293] More rigor in UTF-8-ness of Encode's toUnicode XS export some of the utf8 internal functions. Test some of the functions. Fix pp_concat() bug shown by said tests. p4raw-link: @8293 on //depot/perlio: a12c0f5690a38b5b84d767b0f8b7cc133a68affc p4raw-id: //depot/perl@8295 p4raw-integrated: from //depot/perlio@8292 'copy in' ext/Encode/Encode.xs (@8285..) ext/Encode/Encode.pm (@8290..) pp_hot.c t/lib/encode.t (@8293..)
Diffstat (limited to 't')
-rw-r--r--t/lib/encode.t13
1 files changed, 11 insertions, 2 deletions
diff --git a/t/lib/encode.t b/t/lib/encode.t
index 34527d7cc1..280c2d0ed5 100644
--- a/t/lib/encode.t
+++ b/t/lib/encode.t
@@ -16,7 +16,7 @@ my @character_set = ('0'..'9', 'A'..'Z', 'a'..'z');
my @source = qw(ascii iso8859-1 cp1250);
my @destiny = qw(cp1047 cp37 posix-bc);
my @ebcdic_sets = qw(cp1047 cp37 posix-bc);
-plan test => 13+$n*@encodings + 2*@source*@destiny*@character_set + 2*@ebcdic_sets*256;
+plan test => 21+$n*@encodings + 2*@source*@destiny*@character_set + 2*@ebcdic_sets*256;
my $str = join('',map(chr($_),0x20..0x7E));
my $cpy = $str;
ok(length($str),from_to($cpy,'iso8859-1','Unicode'),"Length Wrong");
@@ -47,7 +47,7 @@ foreach my $enc (qw(symbol dingbats ascii),@encodings)
# On ASCII based machines see if we can map several codepoints from
# three distinct ASCII sets to three distinct EBCDIC coded character sets.
-# On EBCDIC machines see if we can map from three EBCDIC sets to three
+# On EBCDIC machines see if we can map from three EBCDIC sets to three
# distinct ASCII sets.
my @expectation = (240..249, 193..201,209..217,226..233, 129..137,145..153,162..169);
@@ -91,3 +91,12 @@ foreach my $enc_eb (@ebcdic_sets)
}
}
+for $i (256,128,129,256)
+ {
+ my $c = chr($i);
+ my $s = "$c\n".sprintf("%02X",$i);
+ ok(Encode::valid_utf8($s),1,"concat of $i botched");
+ Encode::utf8_upgrade($s);
+ ok(Encode::valid_utf8($s),1,"concat of $i botched");
+ }
+