develooper Front page | perl.perl5.porters | Postings from May 2003

Re: the new Encode.t test

Thread Next
From:
Dan Kogai
Date:
May 19, 2003 13:07
Subject:
Re: the new Encode.t test
Message ID:
C0F805F4-8A31-11D7-8C22-000393AE4244@dan.co.jp
On Tuesday, May 20, 2003, at 03:18  AM, Jarkko Hietaniemi wrote:
> Might not have worked (19559 was your patch):
>
> http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-05/ 
> msg00908.html

Now Duplicated Here.  This time I really built whole perl w/ -Uuseperlio
> > ../perl harness ../ext/Encode/t/Unicode.t.old |& grep -v #
> Wide character in print at ../lib/Test/Builder.pm line 910.
> Wide character in print at ../lib/Test/Builder.pm line 910.
> Wide character in print at ../lib/Test/Builder.pm line 910.
> Wide character in print at ../lib/Test/Builder.pm line 910.
> Wide character in print at ../lib/Test/Builder.pm line 910.
> Wide character in print at ../lib/Test/Builder.pm line 910.
> Wide character in print at ../lib/Test/Builder.pm line 910.
> dubious
>         Test returned status 7 (wstat 1792, 0x700)
> DIED. FAILED tests 31-37
>         Failed 7/37 tests, 81.08% okay
> Failed 1/1 test scripts, 0.00% okay. 7/37 subtests failed, 81.08% okay.
> Failed Test                       Stat Wstat Total Fail  Failed  List  
> of Failed
> ----------------------------------------------------------------------- 
> --------
> /home/dankogai/work/perl-current/    7  1792    37    7  18.92%  31-37

And this time it is really fixed.

> > ../perl harness ../ext/Encode/t/Unicode.t | & grep -v #
> /home/dankogai/work/perl-current/ext/Encode/t/Unicode....ok
> All tests successful.
> Files=1, Tests=37,  4 wallclock secs ( 2.91 cusr +  0.12 csys =  3.04  
> CPU)

Patch follows.

Dan the Encode Maintainer

===================================================================
RCS file: t/Unicode.t,v
retrieving revision 1.11
diff -u -r1.11 t/Unicode.t
--- t/Unicode.t 2003/05/19 04:56:03     1.11
+++ t/Unicode.t 2003/05/19 19:31:36
@@ -117,12 +117,15 @@
  for my $file (@file){
      my $path = File::Spec->catfile($dir, $file);
      open my $fh, '<', $path or die "$path:$!";
+    my $content;
      if (PerlIO::Layer->find('perlio')){
         binmode $fh => ':utf8';
-    }else{
+       $content = join('' => <$fh>);
+    }else{ # ugh!
         binmode $fh;
+       $content = join('' => <$fh>);
+       Encode::_utf8_on($content)
      }
-    my $content = join('' => <$fh>);
      close $fh;
      is(decode("UTF-7", encode("UTF-7", $content)), $content,
         "UTF-7 RT:$file");


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About