diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-12-17 16:26:01 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-12-17 16:26:01 +0000 |
commit | 24df86f67f7cf96bcbc3b5d928e7421c1d7d5454 (patch) | |
tree | aa71aa2641c46f659247b00270003c589f24cdfc /t/op | |
parent | a0a388a13daad79062b3c4b126f22d2f46fc82dd (diff) | |
download | perl-24df86f67f7cf96bcbc3b5d928e7421c1d7d5454.tar.gz |
Add standard test preamble
Remove dependency on Cwd
p4raw-id: //depot/perl@32629
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/reg_fold.t | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/t/op/reg_fold.t b/t/op/reg_fold.t index 6064ecfa69..3126dfcc56 100644 --- a/t/op/reg_fold.t +++ b/t/op/reg_fold.t @@ -1,13 +1,18 @@ +#!perl + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + use strict; use warnings; use Test::More; my $count=1; my @tests; -use Cwd; my $file="../lib/unicore/CaseFolding.txt"; -open my $fh,"<",$file - or die "Failed to read '$file' from '".cwd()."': $!"; +open my $fh,"<",$file or die "Failed to read '$file': $!"; while (<$fh>) { chomp; my ($line,$comment)= split/\s+#\s+/, $_; @@ -21,8 +26,8 @@ while (<$fh>) { if ($cpv<256) { push @str,"do{my \$c=$chr; utf8::upgrade(\$c); \$c}" } - - foreach my $str ( @str ) { + + foreach my $str ( @str ) { my $expr="$str=~/@fc/ix"; my $t=($cpv > 256 || $str=~/^do/) ? "unicode" : "latin"; push @tests, @@ -31,7 +36,7 @@ while (<$fh>) { if $cp eq '0390' or $cp eq '03B0'; $count++; } -} +} eval join ";\n","plan tests=>".($count-1),@tests,"1" or die $@; __DATA__ |