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

[PATCH] better error diagnosis from t/op/sysio.t

From:
andreas.koenig
Date:
December 27, 2001 00:27
Subject:
[PATCH] better error diagnosis from t/op/sysio.t
Message ID:
m3n105gjk3.fsf@anima.de
This is a harmless patch. IF the disk is full, we can stop this test
script after test 20. Patch also reformats a long line and trailing
whitespace.

--- /usr/sources/perl/repoperls/perl-5.7.2@13899/t/op/sysio.t	Mon Jul  9 16:11:29 2001
+++ perl-5.7.2@13899/t/op/sysio.t	Thu Dec 27 09:17:23 2001
@@ -6,7 +6,11 @@
 
 open(I, 'sysio.t') || die "sysio.t: cannot find myself: $!";
 
-$reopen = ($^O eq 'VMS' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'dos' ||
+$reopen = ($^O eq 'VMS' ||
+           $^O eq 'os2' ||
+           $^O eq 'MSWin32' ||
+           $^O eq 'NetWare' ||
+           $^O eq 'dos' ||
 	   $^O eq 'mpeix');
 
 $x = 'abc';
@@ -108,8 +112,14 @@
 print "ok 19\n";
 
 # default offset 0
-print 'not ' unless (syswrite(O, $a, 2) == 2);
-print "ok 20\n";
+if (syswrite(O, $a, 2) == 2){
+  print "ok 20\n";
+} else {
+  print "# $!\nnot ok 20\n";
+  # most other tests make no sense after e.g. "No space left on device"
+  die $!;
+}
+
 
 # $a still intact
 print 'not ' unless ($a eq "#!.\0\0erl");
@@ -203,7 +213,7 @@
 
 unlink $outfile;
 
-chdir('..'); 
+chdir('..');
 
 1;
 

-- 
andreas



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About