Change 16239 by jhi@alpha on 2002/04/28 02:19:45
Subject: [PATCH] Truncate the truncate tests (was Re: truncate to grow file)
From: Michael G Schwern <[EMAIL PROTECTED]>
Date: Sat, 27 Apr 2002 23:20:19 -0400
Message-ID: <20020428032019.GF1821@blackrider>
Affected files ...
.... //depot/perl/pod/perlfunc.pod#317 edit
.... //depot/perl/t/io/fs.t#47 edit
Differences ...
==== //depot/perl/pod/perlfunc.pod#317 (text) ====
Index: perl/pod/perlfunc.pod
--- perl/pod/perlfunc.pod.~1~ Sat Apr 27 20:30:05 2002
+++ perl/pod/perlfunc.pod Sat Apr 27 20:30:05 2002
@@ -5644,6 +5644,9 @@
on your system. Returns true if successful, the undefined value
otherwise.
+The behavior is undefined if LENGTH is greater than the length of the
+file.
+
=item uc EXPR
=item uc
==== //depot/perl/t/io/fs.t#47 (xtext) ====
Index: perl/t/io/fs.t
--- perl/t/io/fs.t.~1~ Sat Apr 27 20:30:05 2002
+++ perl/t/io/fs.t Sat Apr 27 20:30:05 2002
@@ -263,7 +263,7 @@
SKIP: {
# Check truncating a closed file.
eval { truncate "Iofs.tmp", 5; };
-
+
skip("no truncate - $@", 10) if $@;
is(-s "Iofs.tmp", 5, "truncation to five bytes");
@@ -295,7 +295,7 @@
if ($needs_fh_reopen) {
close (FH); open (FH, ">>Iofs.tmp") or die "Can't reopen Iofs.tmp";
}
-
+
if ($^O eq 'vos') {
skip ("# TODO - hit VOS bug posix-973 - cannot resize an open file below the
current file pos.", 7);
}
@@ -310,12 +310,6 @@
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.