summaryrefslogtreecommitdiff
path: root/lib/File
diff options
context:
space:
mode:
authorSteve Hay <SteveHay@planit.com>2005-12-13 09:41:29 +0000
committerSteve Hay <SteveHay@planit.com>2005-12-13 09:41:29 +0000
commit8974ce1ee942c407c5080e83810eaada482b2f0f (patch)
tree60698b65c95301261df5a2b86caa13b2810f3c91 /lib/File
parent5cbf7fcfd7c08a8eda4c6ba4b034b3bc9fcbb874 (diff)
downloadperl-8974ce1ee942c407c5080e83810eaada482b2f0f.tar.gz
Fix lib/File/Compare.t test failures on Win32
Change 26225, updated by 26245, added a test for another filename with a trailing space but failed to open the new filehandle in binary mode To compound matters, creating a file called "foo " on Win32 "succeeds" but actually creates a file called just "foo", so we have actually overwritten the original file with this non-binary mode version, and hence some of the original tests started failing too! (And because of this the new test doesn't actually add anything new on Win32 at the moment, but right now I can't think of a filename that would have failed under 2-arg open but succeeds with 3-arg open, which was the purpose of this test) p4raw-id: //depot/perl@26337
Diffstat (limited to 'lib/File')
-rw-r--r--lib/File/Compare.t9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/File/Compare.t b/lib/File/Compare.t
index 504c78998b..8c369f41b6 100644
--- a/lib/File/Compare.t
+++ b/lib/File/Compare.t
@@ -79,8 +79,9 @@ eval {
my $template = File::Spec->catfile(File::Spec->tmpdir, 'fcmpXXXX');
my($tfh,$filename) = mkstemp($template);
# NB. The trailing space is intentional (see [perl #37716])
- open my $tfhCR, ">", "$filename "
- or die "Could no open '$filename^M' for writing: $!";
+ open my $tfhSP, ">", "$filename "
+ or die "Could not open '$filename ' for writing: $!";
+ binmode($tfhSP);
{
local $/; #slurp
my $fh;
@@ -89,8 +90,8 @@ eval {
my $data = <$fh>;
print $tfh $data;
close($fh);
- print $tfhCR $data;
- close($tfhCR);
+ print $tfhSP $data;
+ close($tfhSP);
}
seek($tfh,0,0);
$donetests[0] = compare($tfh, 'README');