summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNikola Knezevic <indy@tesla.rcub.bg.ac.yu>2002-02-21 16:10:21 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2002-02-21 15:41:10 +0000
commit7a2cf369e16a2ef8ad45d686139073724ed14fe2 (patch)
tree4f537ccc53a235cc8f2983a5e50d27f7599de15d /t
parente32bd022c07d8ee0432dd8e95671a86ff9f6d991 (diff)
downloadperl-7a2cf369e16a2ef8ad45d686139073724ed14fe2.tar.gz
question about fs.t
Message-ID: <725805519.20020221151021@tesla.rcub.bg.ac.yu> p4raw-id: //depot/perl@14814
Diffstat (limited to 't')
-rwxr-xr-xt/io/fs.t22
1 files changed, 18 insertions, 4 deletions
diff --git a/t/io/fs.t b/t/io/fs.t
index f3c49c9118..8e74a810c4 100755
--- a/t/io/fs.t
+++ b/t/io/fs.t
@@ -39,7 +39,9 @@ my $needs_fh_reopen =
# 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 @@ SKIP: {
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 @@ SKIP: {
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 @@ SKIP: {
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;
}