From: Nicholas Clark Date: Tue, 6 Oct 2009 12:05:20 +0000 (+0200) Subject: Standardise t/uni/*.t on ./test.pl, and remove PERL_CORE boilerplate. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e4206093c9a6ef09175024ffdd3930ca2c116c26;p=p5sagit%2Fp5-mst-13.2.git Standardise t/uni/*.t on ./test.pl, and remove PERL_CORE boilerplate. TestInit sets up the directory for us. Also remove unncessary Cs. --- diff --git a/t/uni/chomp.t b/t/uni/chomp.t index 5f52558..6aef50c 100644 --- a/t/uni/chomp.t +++ b/t/uni/chomp.t @@ -1,10 +1,6 @@ #!./perl -w 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"; @@ -22,11 +18,12 @@ BEGIN { print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n"; exit 0; } + + require './test.pl'; } -use Encode; use strict; -use Test::More; +use Encode; # %mbchars = (encoding => { bytes => utf8, ... }, ...); # * pack('C*') is expected to return bytes even if ${^ENCODING} is true. diff --git a/t/uni/chr.t b/t/uni/chr.t index ab710d9..8d7924f 100644 --- a/t/uni/chr.t +++ b/t/uni/chr.t @@ -1,9 +1,6 @@ +#!./perl -w 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"; @@ -22,12 +19,12 @@ BEGIN { exit 0; } $| = 1; + + require './test.pl'; } use strict; -use Test::More tests => 6; -use Encode; - +plan (tests => 6); use encoding 'johab'; ok(chr(0x7f) eq "\x7f"); diff --git a/t/uni/lex_utf8.t b/t/uni/lex_utf8.t index c7d1778..2aa9221 100644 --- a/t/uni/lex_utf8.t +++ b/t/uni/lex_utf8.t @@ -1,3 +1,4 @@ +#!./perl -w # # This script is written intentionally in UTF-8 @@ -7,11 +8,13 @@ BEGIN { exit 0; } $| = 1; + + require './test.pl'; } use strict; -use Test::More tests => 10; +plan (tests => 10); use charnames ':full'; use utf8; diff --git a/t/uni/overload.t b/t/uni/overload.t index d44d171..d7c06f5 100644 --- a/t/uni/overload.t +++ b/t/uni/overload.t @@ -1,13 +1,12 @@ #!perl -w BEGIN { - if ($ENV{'PERL_CORE'}){ - chdir 't'; - @INC = '../lib'; - } + chdir 't'; + @INC = '../lib'; + require './test.pl'; } -use Test::More tests => 215; +plan(tests => 215); package UTF8Toggle; use strict; diff --git a/t/uni/tie.t b/t/uni/tie.t index fa9f268..28ea0dc 100644 --- a/t/uni/tie.t +++ b/t/uni/tie.t @@ -1,13 +1,10 @@ #!perl -w BEGIN { - if ($ENV{'PERL_CORE'}){ - chdir 't'; - @INC = '../lib'; - } + require './test.pl'; } -use Test::More tests => 9; +plan (tests => 9); use strict; { @@ -44,6 +41,6 @@ foreach my $t ("ASCII", "B\366se") { } { - local $TODO = "Need more tests!"; + local $::TODO = "Need more tests!"; fail(); } diff --git a/t/uni/tr_7jis.t b/t/uni/tr_7jis.t index 54df6a0..214f456 100644 --- a/t/uni/tr_7jis.t +++ b/t/uni/tr_7jis.t @@ -1,3 +1,4 @@ +#! perl -w # # $Id$ # @@ -6,10 +7,6 @@ # -- dankogai 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"; @@ -28,11 +25,11 @@ BEGIN { exit 0; } $| = 1; + require './test.pl'; } use strict; -use Test::More tests => 6; -use Encode; +plan(tests => 6); use encoding 'iso-2022-jp'; my @hiragana = map {chr} ord("$B$!(B")..ord("$B$s(B"); diff --git a/t/uni/tr_eucjp.t b/t/uni/tr_eucjp.t index 03dec71..98c6845 100644 --- a/t/uni/tr_eucjp.t +++ b/t/uni/tr_eucjp.t @@ -1,3 +1,4 @@ +#! perl -w # # $Id$ # @@ -5,10 +6,6 @@ # -- dankogai 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"; @@ -27,11 +24,11 @@ BEGIN { exit 0; } $| = 1; + require './test.pl'; } use strict; -use Test::More tests => 6; -use Encode; +plan(tests => 6); use encoding 'euc-jp'; my @hiragana = map {chr} ord("¤¡")..ord("¤ó"); diff --git a/t/uni/tr_sjis.t b/t/uni/tr_sjis.t index 9e05167..dd4fe0c 100644 --- a/t/uni/tr_sjis.t +++ b/t/uni/tr_sjis.t @@ -1,3 +1,4 @@ +#!perl -w # # $Id$ # @@ -5,10 +6,6 @@ # -- dankogai 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"; @@ -27,11 +24,11 @@ BEGIN { exit 0; } $| = 1; + require './test.pl'; } use strict; -use Test::More tests => 6; -use Encode; +plan(tests => 6); use encoding 'shiftjis'; my @hiragana = map {chr} ord("‚Ÿ")..ord("‚ñ"); diff --git a/t/uni/tr_utf8.t b/t/uni/tr_utf8.t index 354156a..12ed430 100644 --- a/t/uni/tr_utf8.t +++ b/t/uni/tr_utf8.t @@ -1,3 +1,4 @@ +#!perl -w # # $Id$ # @@ -28,11 +29,11 @@ BEGIN { exit 0; } $| = 1; + require './test.pl'; } use strict; -use Test::More tests => 8; - +plan(tests => 8); use encoding 'utf8'; my @hiragana = map {chr} ord("ぁ")..ord("ん");