Change 14814 by jhi@alpha on 2002/02/21 15:41:10
Subject: [PATCH propose] question about fs.t
From: Nikola Knezevic <[EMAIL PROTECTED]>
Date: Thu, 21 Feb 2002 15:10:21 +0100
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
.... //depot/perl/t/io/fs.t#41 edit
Differences ...
==== //depot/perl/t/io/fs.t#41 (xtext) ====
Index: perl/t/io/fs.t
--- perl/t/io/fs.t.~1~ Thu Feb 21 08:45:06 2002
+++ perl/t/io/fs.t Thu Feb 21 08:45:06 2002
@@ -39,7 +39,9 @@
# Not needed on HPFS, but needed on HPFS386 ?!
|| $^O eq 'os2';
-plan tests => 32;
+$needs_fh_reopen = 1 if (defined &Win32::IsWin95 && Win32::IsWin95());
+
+plan tests => 36;
if (($^O eq 'MSWin32') || ($^O eq 'NetWare')) {
@@ -249,7 +251,14 @@
ok(-z "Iofs.tmp", "truncation to zero bytes");
+#these steps are necessary to check if file is really truncated
+#On Win95, FH is updated, but file properties aren't
open(FH, ">Iofs.tmp") or die "Can't create Iofs.tmp";
+ print FH "x\n" x 200;
+ close FH;
+
+
+ open(FH, ">>Iofs.tmp") or die "Can't open Iofs.tmp for appending";
binmode FH;
select FH;
@@ -265,8 +274,8 @@
if ($needs_fh_reopen) {
close (FH); open (FH, ">>Iofs.tmp") or die "Can't reopen Iofs.tmp";
}
-
- is(-s "Iofs.tmp", 200, "fh resize to 200 working");
+
+ is(-s "Iofs.tmp", 200, "fh resize to 200 working (filename check)");
ok(truncate(FH, 0), "fh resize to zero");
@@ -274,8 +283,13 @@
close (FH); open (FH, ">>Iofs.tmp") or die "Can't reopen Iofs.tmp";
}
- ok(-z "Iofs.tmp", "fh resize to zero working");
+ ok(-z "Iofs.tmp", "fh resize to zero working (filename check)");
+
+ ok(truncate(FH, 200), "fh resize to 200");
+ is(-s FH, 200, "fh resize to 200 working (FH check)");
+ ok(truncate(FH, 0), "fh resize to 0");
+ ok(-z FH, "fh resize to 0 working (FH check)");
close FH;
}
End of Patch.