Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t: Fix indirect syntax #176

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion t/Aliases.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/CJKT.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/Encode.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BEGIN {
print "1..0 # Skip: EBCDIC\n";
exit 0;
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/Encoder.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/Unicode.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
34 changes: 17 additions & 17 deletions t/at-cn.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down Expand Up @@ -49,16 +49,16 @@ run_tests('Simplified Chinese only', {
),

'euc-cn' => join('',
'《易经》第一卦',
'彖曰:',
'大哉乾元,万物资始,',
'乃统天。',
'云行雨施,品物流形。',
'大明始终,六位时成,',
'时乘六龙以御天。',
'乾道变化,各正性命,',
'保合大和,乃利贞。',
'首出庶物,万国咸宁。',
'锟斤拷锟阶撅拷锟斤拷锟斤拷一锟斤拷',
'锟斤拷曰锟斤拷',
'锟斤拷锟斤拷乾元锟斤拷锟斤拷锟斤拷锟斤拷始锟斤拷',
'锟斤拷统锟届。',
'锟斤拷锟斤拷锟斤拷施锟斤拷品锟斤拷锟斤拷锟轿★拷',
'锟斤拷锟斤拷始锟秸o拷锟斤拷位时锟缴o拷',
'时锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟届。',
'乾锟斤拷锟戒化锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷',
'锟斤拷锟较达拷停锟斤拷锟斤拷锟斤拷辍�',
'锟阶筹拷锟斤拷锟斤,锟斤拷锟斤拷锟斤拷锟斤拷锟�',
),

'gb2312-raw' => join('',
Expand Down Expand Up @@ -102,11 +102,11 @@ run_tests('Simplified Chinese + ASCII', {
),

'cp936' => join(chr(10),
'象曰:',
'天行健,君子以自强不息。',
'潜龙勿用,阳在下也。 见龙在田,德施普也。 终日乾乾,反复道也。',
'或跃在渊,进无咎也。飞龙在天,大人造也。 亢龙有悔,盈不可久也。',
'用九,天德不可为首也。',
'锟斤拷曰锟斤拷',
'锟斤拷锟叫斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷强锟斤拷息锟斤拷',
'潜锟斤拷锟斤拷锟矫o拷锟斤拷锟斤拷锟斤拷也锟斤拷 锟斤拷锟斤拷锟斤拷锟斤,锟斤拷施锟斤拷也锟斤拷 锟斤拷锟斤拷乾乾锟斤拷锟斤拷锟斤拷锟斤拷也锟斤拷',
'锟斤拷跃锟斤拷渊锟斤拷锟斤拷锟睫撅拷也锟斤拷锟斤拷锟斤拷锟斤拷锟届,锟斤拷锟斤拷锟斤拷也锟斤拷 锟斤拷锟斤拷锟叫悔o拷盈锟斤拷锟缴撅拷也锟斤拷',
'锟矫九o拷锟斤拷虏锟斤拷锟轿拷锟揭诧拷锟�',
),

'hz' => join(chr(10),
Expand All @@ -121,7 +121,7 @@ run_tests('Simplified Chinese + ASCII', {
run_tests('Traditional Chinese', {
'utf', => 20094.65306.20803.12289.20136.12289.21033.12289.35998,
'gb12345-raw' => 'G,#:T*!":`!"@{!"Uj',
'gbk' => '乾:元、亨、利、貞',
'gbk' => '乾锟斤拷元锟斤拷锟洁、锟斤拷锟斤拷貞',
});

sub run_tests {
Expand Down
18 changes: 9 additions & 9 deletions t/at-tw.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN {
if (! -d 'blib' and -d 't'){ chdir 't' };
unshift @INC, '../lib';
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down Expand Up @@ -45,18 +45,18 @@ run_tests('Basic Big5 range', {
),

'big5' => (join('',
'蔼锭ぇ璢盖ぜσり眅',
'尼矗璼﹕车ぜ暴┌盙',
'锟揭帮拷锟斤拷锟斤拷锟絔锟角わ拷锟紸锟接σわ拷B锟絜锟絈',
'锟结矗锟絪锟絖锟絪锟斤拷锟斤拷锟紸锟斤拷锟斤拷锟紾锟絕锟紿锟斤拷锟絈',
)),

'big5-hkscs'=> (join('',
'蔼锭ぇ璢盖ぜσり眅',
'尼矗璼﹕车ぜ暴┌盙',
'锟揭帮拷锟斤拷锟斤拷锟絔锟角わ拷锟紸锟接σわ拷B锟絜锟絈',
'锟结矗锟絪锟絖锟絪锟斤拷锟斤拷锟紸锟斤拷锟斤拷锟紾锟絕锟紿锟斤拷锟絈',
)),

'cp950' => (join('',
'蔼锭ぇ璢盖ぜσり眅',
'尼矗璼﹕车ぜ暴┌盙',
'锟揭帮拷锟斤拷锟斤拷锟絔锟角わ拷锟紸锟接σわ拷B锟絜锟絈',
'锟结矗锟絪锟絖锟絪锟斤拷锟斤拷锟紸锟斤拷锟斤拷锟紾锟絕锟紿锟斤拷锟絈',
)),
});

Expand All @@ -70,8 +70,8 @@ run_tests('Hong Kong Extensions', {
),

'big5-hkscs' => join('',
'稰谅┮Τㄏノ Perl 濓狟ね倒и抅濓や種ǎ㎝躬纘',
'狦絪絏Τヴ岿簗叫禗и抅'
'锟絇锟铰┮︼拷锟较ワ拷 Perl 锟斤拷B锟酵锟斤拷锟节抅锟斤拷锟斤拷锟紹锟絅锟斤拷锟組锟斤拷锟統',
'锟絧锟紾锟絪锟絏锟斤拷锟斤拷锟斤拷锟斤拷|锟紸锟叫锟紻锟节抅锟紺'
),
});

Expand Down
16 changes: 8 additions & 8 deletions t/enc_data.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $Id: enc_data.t,v 2.6 2022/04/07 03:06:40 dankogai Exp $

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down Expand Up @@ -34,16 +34,16 @@ my @a;

while (<DATA>) {
chomp;
tr/ぁ-んァ-ン/ァ-ンぁ-ん/;
tr/锟斤拷-锟斤拷-锟斤拷/锟斤拷-锟斤拷-锟斤拷/;
push @a, $_;
}

is(scalar @a, 3);
is($a[0], "コレハDATAふぁいるはんどるノてすとデス。");
is($a[1], "泣塑胳ガチャント恃垂デキルカ");
is($a[2], "ドウカノてすとヲシテイマス。");
is($a[0], "锟斤拷锟斤拷锟紻ATA锟秸わ拷锟斤拷锟斤拷悉锟缴わ拷韦皮锟斤拷去钎锟斤拷锟�");
is($a[1], "锟斤拷锟杰胳ガ锟斤拷锟斤拷锟斤拷锟窖达拷锟角ワ拷锟诫カ");
is($a[2], "锟缴ワ拷锟斤拷锟轿てわ拷锟饺ヲシテワ拷锟睫ワ拷锟斤拷");

__DATA__
これはDATAファイルハンドルのテストです。
泣塑胳がちゃんと恃垂できるか
どうかのテストをしています。
锟斤拷锟斤拷锟紻ATA锟秸ワ拷锟斤拷锟斤拷膝锟缴ワ拷违匹锟斤拷趣扦锟斤拷锟�
锟斤拷锟杰胳が锟斤拷锟斤拷锟斤拷锟窖达拷锟角わ拷锟诫か
锟缴わ拷锟斤拷锟轿テワ拷锟饺をしてわ拷锟睫わ拷锟斤拷
2 changes: 1 addition & 1 deletion t/enc_eucjp.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This is the twin of enc_utf8.t .

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
6 changes: 3 additions & 3 deletions t/enc_module.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $Id: enc_module.t,v 2.6 2022/04/07 03:06:40 dankogai Exp $
# This file is in euc-jp
BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down Expand Up @@ -43,7 +43,7 @@ local $SIG{__WARN__} = sub{ $DEBUG and print STDERR @_ };

open STDOUT, ">", $file1 or die "$file1:$!";
print $obj->str, "\n";
$obj->set("テスト矢机误");
$obj->set("锟狡ワ拷锟斤拷矢锟斤拷锟斤拷");
print $obj->str, "\n";

# Please do not move this to a point after the comparison -- Craig Berry
Expand All @@ -54,7 +54,7 @@ close STDOUT unless $^O eq 'freebsd';
my $cmp = compare_text($file0, $file1);
is($cmp, 0, "encoding vs. STDOUT");

my @cmp = qw/介袋矢机误 テスト矢机误/;
my @cmp = qw/锟斤拷锟绞革拷锟斤拷锟� 锟狡ワ拷锟斤拷矢锟斤拷锟斤拷/;
open STDIN, "<", $file0 or die "$file0:$!";
$obj = Mod_EUCJP->new;
my $i = 0;
Expand Down
2 changes: 1 addition & 1 deletion t/enc_utf8.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This is the twin of enc_eucjp.t .

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/encoding.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/fallback.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/grow.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/gsm0338.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/guess.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
12 changes: 6 additions & 6 deletions t/jperl.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This script is written in euc-jp

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down Expand Up @@ -36,13 +36,13 @@ no encoding; # ensure
my $Enamae = "\xbe\xae\xbb\xf4\x20\xc3\xc6"; # euc-jp, with \x escapes
use encoding "euc-jp";

my $Namae = "井霍 闷"; # in Japanese, in euc-jp
my $Namae = "锟斤拷锟斤拷 锟斤拷"; # in Japanese, in euc-jp
my $Name = "Dan Kogai"; # in English
# euc-jp in \x format but after the pragma. But this one will be converted!
my $Ynamae = "\xbe\xae\xbb\xf4\x20\xc3\xc6";


my $str = $Namae; $str =~ s/井霍 闷/Dan Kogai/o;
my $str = $Namae; $str =~ s/锟斤拷锟斤拷 锟斤拷/Dan Kogai/o;
is($str, $Name, q{regex});
$str = $Namae; $str =~ s/$Namae/Dan Kogai/o;
is($str, $Name, q{regex - with variable});
Expand Down Expand Up @@ -91,10 +91,10 @@ is (length($Namae), 10);
no strict 'vars'; # fools
# doesn't work w/ "my" as of this writing.
# because of buggy strict.pm and utf8.pm
our $ = 2;
our $锟斤拷 = 2;
# ^^U+4eba, "human" in CJK ideograph
$++; # a child is born
*people = \$;
$锟斤拷++; # a child is born
*people = \$锟斤拷;
is ($people, 3, "Filter:utf8 identifier");
no encoding;
ok(1, "Filter off");
Expand Down
2 changes: 1 addition & 1 deletion t/magic.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/mime-header.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/mime-name.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/perlio.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/rt.pl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BEGIN
unshift @INC, '../lib';
$ucmdir = "../ext/Encode/ucm";
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/rt113164.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/rt65541.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/rt76824.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/rt85489.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion t/rt86327.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BEGIN {
chdir 't';
unshift @INC, '../lib';
}
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
exit 0;
Expand Down
Loading
Loading