Skip Menu |

This queue is for tickets about the Tie-File CPAN distribution.

Report information
The Basics
Id: 9832
Status: resolved
Priority: 0/
Queue: Tie-File

People
Owner: Nobody in particular
Requestors: barbie [...] missbarbell.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.96
Fixed in: (no value)



Subject: _default_recsep incompatibility in tests
In the test script 09_gen_rs.t, there is a test for a badly terminated file (line 150). However, the test will work fine on all platforms apart from Windows. The string being tested includes the '\n' on its own, which is then written to the file in binmode to ensure only the '\n' gets written. Unfortunately a few tests earlier the $RECSEP variable is reset to the _default_recsep() value, which for MSWin32 is set to '\r\n', as such the file is read into $a[0] completely. Admittedly the attached patch is a bit of a cop-out, but it works ;) For further details see my cpan-testers report: http://www.nntp.perl.org/group/perl.cpan.testers/119596
--- C:\wip\diffs\Tie-File\Tie-File-0.96/t/09_gen_rs.t Mon Jan 17 17:15:05 2005 +++ C:\wip\diffs\Tie-File\Tie-File-0.96-barbie/t/09_gen_rs.t Mon Jan 17 18:19:47 2005 @@ -147,11 +147,10 @@ # There's special-case code to fix the final record when it is read normally. # But the $#a forces it to be read from the cache, which skips the # termination. -$badrec = "world\nhello"; +$badrec = "world${RECSEP}hello"; if (setup_badly_terminated_file(1)) { tie(@a, "Tie::File", $file, mode => 0, recsep => $RECSEP) or die "Couldn't tie file: $!"; my $z = $#a; $z = $a[1]; print $z eq "hello" ? "ok $N\n" :
This looks like it's been fixed for a while.