From: Rafael Garcia-Suarez Date: Fri, 19 Apr 2002 19:54:08 +0000 (+0000) Subject: More tests for the 3-arg open X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=35066d42e36f71d632908552650c0035ec450cdb;p=p5sagit%2Fp5-mst-13.2.git More tests for the 3-arg open p4raw-id: //depot/perl@16008 --- diff --git a/t/io/open.t b/t/io/open.t index fa8b10a..a24a547 100755 --- a/t/io/open.t +++ b/t/io/open.t @@ -8,9 +8,10 @@ BEGIN { $| = 1; use warnings; +use Config; $Is_VMS = $^O eq 'VMS'; -plan tests => 91; +plan tests => 94; my $Perl = which_perl(); @@ -223,3 +224,14 @@ like( $@, qr/Bad filehandle:\s+afile/, ' right error' ); ok( open(STDOUT, ">&", $stdout), 'restore dupped STDOUT from lexical fh'); } +SKIP: { + skip "This perl uses perlio", 1 if $Config{useperlio}; + skip "This system doesn't understand EINVAL", 1 unless exists $!{EINVAL}; + + ok( !open(F,'>',\my $s) && $!{EINVAL}, 'open(reference) raises EINVAL' ); +} + +{ + ok( !eval { open F, "BAR", "QUUX" }, 'Unknown open() mode' ); + like( $@, qr/\QUnknown open() mode 'BAR'/, ' right error' ); +} diff --git a/t/lib/warnings/doio b/t/lib/warnings/doio index db57195..569229d 100644 --- a/t/lib/warnings/doio +++ b/t/lib/warnings/doio @@ -243,6 +243,7 @@ EOM use warnings 'io'; my $x = "foo"; open FOO, '>', \$x; +open BAR, '>&', \*STDOUT; # should not warn no warnings 'io'; open FOO, '>', \$x; EXPECT