On Mon, Sep 16, 2013 at 12:33:51PM +1000, Ron Savage wrote:
> Hi
> 
> I'm getting a few reports like:
> 
> http://www.cpantesters.org/cpan/report/eb649035-6c13-1014-9608-8f71db05e747
> 
> If I copy-and-paste the first 'got' and 'expected' strings, they are
> the same.
> 
> I'm using File::Slurp's read_file() with
> 
> {binmode => ':encoding(utf8)'}
> 
> but without the chomp option, and calling is(read_file....).
> 
> Would it be likely that the problem is due to the got being a
> Windows file and the expected (shipped) output file is from my
> Debian box?

The problem is you open your test output files without :raw, so the
default :crlf layer on Win32 is left in place.

This means your test output file contains CRs, but your Debian
generated sample files don't.

Since sysread()[1] and hence File::Slurp[2] ignores layers except for
the UTF-8 flag, there's no :crlf layer processing to remove the CRs
when you read the test output is read back in.

Change the open() on line 27 of t/read.tree.t to:

        open(OUT, '> :raw:encoding(utf8)', $test_file_name);

all tests pass for me on Strawberry perl.

Tony

[1] probably a bug

[2] definitely a bug

Reply via email to