Skip Menu |

This queue is for tickets about the HTTP-Server-Simple-Recorder CPAN distribution.

Report information
The Basics
Id: 41302
Status: new
Priority: 0/
Queue: HTTP-Server-Simple-Recorder

People
Owner: Nobody in particular
Requestors: PJF [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.02
Fixed in: (no value)



Subject: [PATCH] 01.live.t fails under Windows due to CRLF issues
The t/01.live.t test reads some log files without first setting binmode() on the filehandles. On Windows systems, this means that CRLF sequences get turned into just LF characters, which then causes the test to (erroneously) break when looking for CRLF sequences in the result. The attached patch fixes this problem.
Subject: 0001-Use-binmode-on-appropriate-filehandles-to-prevent.patch
From 1d64e307490c6cf04c8697c8061e630f0c09932f Mon Sep 17 00:00:00 2001 From: Paul Fenwick <pjf@perltraining.com.au> Date: Sat, 29 Nov 2008 14:42:08 +1100 Subject: [PATCH] Use binmode() on appropriate filehandles to prevent CRLF munging under Windows. --- t/01.live.t | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/t/01.live.t b/t/01.live.t index 1543220..51522fc 100755 --- a/t/01.live.t +++ b/t/01.live.t @@ -37,6 +37,8 @@ unlink map "t/logs/rec.$_", qw/1.in 1.out 2.in 2.out/; my $f = "t/logs/rec.1.in"; ok((open my $fh, "<$f"), "found a log file") or diag("error opening $f: $!"); + binmode($fh); + my $text = do { local $/; <$fh> }; is($text, "GET / HTTP/1.1\015\012\015\012"); @@ -46,6 +48,8 @@ unlink map "t/logs/rec.$_", qw/1.in 1.out 2.in 2.out/; my $f = "t/logs/rec.2.in"; ok((open my $fh, "<$f"), "found a log file") or diag("error opening $f: $!"); + binmode($fh); + my $text = do { local $/; <$fh> }; is($text, "GET /monkey HTTP/1.1\015\012\015\012"); -- 1.5.2.2