summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-04-19 19:54:08 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-04-19 19:54:08 +0000
commit35066d42e36f71d632908552650c0035ec450cdb (patch)
tree7683b53725ecfa880398e9879104ecba74bfb951 /t
parenta14a477edf18528d1dde515f2004bfed9e2e0955 (diff)
downloadperl-35066d42e36f71d632908552650c0035ec450cdb.tar.gz
More tests for the 3-arg open
p4raw-id: //depot/perl@16008
Diffstat (limited to 't')
-rwxr-xr-xt/io/open.t14
-rw-r--r--t/lib/warnings/doio1
2 files changed, 14 insertions, 1 deletions
diff --git a/t/io/open.t b/t/io/open.t
index fa8b10ac6c..a24a5472d7 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 db571957c4..569229d35f 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