summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2002-04-17 17:03:40 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2002-04-17 17:03:40 +0000
commit656d579822f100d9aaa7a17a9f90db686b7dd8a1 (patch)
tree147905018730d09586eb1d532cb58fc3327d2322 /t
parent9444b03807ef4b847f539522706915a803cf8f60 (diff)
parent872a3cb370ab7afd96b68b7e0a09e0e7670570ad (diff)
downloadperl-656d579822f100d9aaa7a17a9f90db686b7dd8a1.tar.gz
Integrate mainline
p4raw-id: //depot/perlio@15976
Diffstat (limited to 't')
-rw-r--r--t/io/full.t32
1 files changed, 32 insertions, 0 deletions
diff --git a/t/io/full.t b/t/io/full.t
new file mode 100644
index 0000000000..917050f037
--- /dev/null
+++ b/t/io/full.t
@@ -0,0 +1,32 @@
+#!./perl
+#
+# Test for 'disk full' errors, if possible
+# 20020416 mjd-perl-patch+@plover.com
+
+unless (-c "/dev/full" && open FULL, "> /dev/full") {
+ print "1..0\n"; exit 0;
+}
+
+my $z;
+print "1..6\n";
+
+print FULL "I like pie.\n" ? print "ok 1\n" : print "not ok 1\n";
+# Should fail
+$z = close(FULL);
+print $z ? "not ok 2 # z=$z; $!\n" : "ok 2\n";
+print $!{ENOSPC} ? "ok 3\n" : "not ok 3\n";
+
+unless (open FULL, "> /dev/full") {
+ print "# couldn't open /dev/full the second time: $!\n";
+ print "not ok $_\n" for 4..6;
+ exit 0;
+}
+
+select FULL; $| = 1; select STDOUT;
+
+# Should fail
+$z = print FULL "I like pie.\n";
+print $z ? "not ok 4 # z=$z; $!\n" : "ok 4\n";
+print $!{ENOSPC} ? "ok 5\n" : "not ok 5\n";
+$z = close FULL;
+print $z ? "ok 6\n" : "not ok 6 # z=$s; $!\n";