develooper Front page | perl.perl5.porters | Postings from September 2001

Re: Question about PERLIO

Thread Previous | Thread Next
From:
chromatic
Date:
September 26, 2001 10:24
Subject:
Re: Question about PERLIO
Message ID:
20010926172418.53706.qmail@onion.perl.org
In article <tov3rtk1pbsub8oi22v8a4bo761i58lrc1@4ax.com>, "Abe Timmerman"
<abe@ztreet.demon.nl> wrote:

> Failed Test      Stat Wstat Total Fail  Failed  List of Failed
> -------------------------------------------------------------------------------
> .\lib/English.t    1   256    54    1   1.85%  48
> 
> not ok 48 - %OS_ERROR (ENOENT should be set) #     Failed test
> (..\lib\English.t at line 128)
> 
> This test involves %OS_ERROR (%!) for which I can't find an entry in
> perlvar.pod
 
It's in Errno.pm.

Does this patch help?  Looking at Errno in more detail, it looks like 'ENOENT'
may be non portable.

-- c

--- lib/~English.t	Wed Sep 26 10:59:09 2001
+++ lib/English.t	Wed Sep 26 11:16:18 2001
@@ -6,9 +6,9 @@
     @INC = '../lib';
 }
 
-use Test::More tests => 54;
+use Test::More tests => 56;
 
-use English qw( -no_match_vars ) ;
+use_ok( 'English','-no_match_vars' );
 use Config;
 use Errno;
 
@@ -125,11 +125,18 @@
 
 eval { open('') };
 is( $OS_ERROR, $ERRNO, '$OS_ERROR' );
-ok( $OS_ERROR{ENOENT}, '%OS_ERROR (ENOENT should be set)' );
+
+my $err_name;
+for (keys %OS_ERROR) {
+	next unless $OS_ERROR{$_};
+	$err_name = $_;
+	last if $OS_ERROR{$err_name} == 0 + $OS_ERROR;
+}
+ok( $OS_ERROR{$err_name}, "\%OS_ERROR ($err_name should be set)" );
 
 package B;
 
-use English;
+main::use_ok( 'English' );
 
 "abc" =~ /b/;

Thread Previous | 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