+#!perl -w
#
# $Id$
#
-# This script is written intentionally in EUC-JP
+# This script is written intentionally in UTF-8
+# Requires Encode 1.83 or better
# -- dankogai
BEGIN {
if ($ENV{'PERL_CORE'}){
chdir 't';
- unshift @INC, '../lib';
+ @INC = '../lib';
}
require Config; import Config;
if ($Config{'extensions'} !~ /\bEncode\b/) {
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;
+ require './test.pl';
}
use strict;
-#use Test::More qw(no_plan);
-use Test::More tests => 6;
-
-# use encoding 'utf8'; # you can't uncomment this!
-# if you uncomment above, you'll get the following (as of Encode 1.80)
-# Assertion ((dst)->sv_flags & 0xff) >= SVt_PV failed:
-# file "Encode.xs", line 255 at t/uni/tr_utf8.t line 35.
+plan(tests => 8);
+use encoding 'utf8';
my @hiragana = map {chr} ord("ぁ")..ord("ん");
my @katakana = map {chr} ord("ァ")..ord("ン");
is($str, $katakana, "s/// # hiragana -> katakana");
$str = $katakana; $str =~ s/([ァ-ン])/$k2h{$1}/go;
is($str, $hiragana, "s/// # hiragana -> katakana");
+
+{
+ # [perl 16843]
+ my $line = 'abcdefghijklmnopqrstuvwxyz$0123456789';
+ $line =~ tr/bcdeghijklmnprstvwxyz$02578/בצדעגהיײקלמנפּרסטװשכיזשױתײחא/;
+ is($line, "aבצדעfגהיײקלמנoפqּרסuטװשכיזש1ױ34ת6ײח9", "[perl #16843]");
+}
+
+{
+ # [perl #40641]
+ my $str = qq/Gebääääääääääääääääääääude/;
+ my $reg = qr/Gebääääääääääääääääääääude/;
+ ok($str =~ /$reg/, "[perl #40641]");
+}
+
__END__