summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTorsten Foertsch <torsten.foertsch@gmx.net>2003-11-22 14:15:53 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-11-25 21:12:19 +0000
commit2d7268923bcf822410c0286f060732300ab91ea7 (patch)
tree30364141ce26d86c92b26dac7c95fea7aecb759b /t
parentdfc05e5b69279e317155520cec7e590d9c42a6bc (diff)
downloadperl-2d7268923bcf822410c0286f060732300ab91ea7.tar.gz
Re: bug or a feature?
Date: Sat, 22 Nov 2003 13:15:53 +0100 Message-Id: <200311221315.58539.torsten.foertsch@gmx.net> and Date: Sat, 22 Nov 2003 14:21:45 +0100 Message-Id: <200311221421.48940.torsten.foertsch@gmx.net> (test moved to t/op/readline.t) p4raw-id: //depot/perl@21787
Diffstat (limited to 't')
-rw-r--r--t/op/readline.t26
1 files changed, 25 insertions, 1 deletions
diff --git a/t/op/readline.t b/t/op/readline.t
index 46375daf75..dec3e5034e 100644
--- a/t/op/readline.t
+++ b/t/op/readline.t
@@ -6,7 +6,7 @@ BEGIN {
require './test.pl';
}
-plan tests => 11;
+plan tests => 13;
eval { for (\2) { $_ = <FH> } };
like($@, 'Modification of a read-only value attempted', '[perl #19566]');
@@ -55,6 +55,30 @@ foreach my $l (1, 21) {
$k .= <DATA>;
is ($k, "$perl rules\n", 'rcatline to COW sv for length ' . length $perl);
}
+
+use strict;
+use File::Spec;
+
+open F, File::Spec->curdir and sysread F, $_, 1;
+my $err = $! + 0;
+close F;
+
+SKIP: {
+ skip 2 => "you can read directories as plain files" unless( $err );
+
+ $!=0;
+ open F, File::Spec->curdir and $_=<F>;
+ ok( $!==$err && !defined($_) => 'readline( DIRECTORY )' );
+ close F;
+
+ $!=0;
+ { local $/;
+ open F, File::Spec->curdir and $_=<F>;
+ ok( $!==$err && !defined($_) => 'readline( DIRECTORY ) slurp mode' );
+ close F;
+ }
+}
+
__DATA__
moo
moo