Skip Menu |
 

This queue is for tickets about the IO-Compress-Lzma CPAN distribution.

Report information
The Basics
Id: 72023
Status: resolved
Priority: 0/
Queue: IO-Compress-Lzma

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

Bug Information
Severity: (no value)
Broken in: 2.039
Fixed in: 2.041

Attachments


Subject: Test failure on Windows
The test t/001lzma.t assumes a directory can be found at /tmp/, which doesn't always exist (this maps to C:\tmp on Windows, but that is highly unlikely to exist). I've attached a patch that uses File::Spec->tmpdir() instead to get the temp directory for the system. I also added a line to clean up the file as well, though I'm not sure if you want that. C:\strawberry\cpan\build\IO-Compress-Lzma-2.039-iCeM6f>prove -l t\001lzma.t t\001lzma.t .. 1/5 # cannot open file '/tmp/lz.lz': No such file or directory # Failed test (t\001lzma.t at line 161) Can't call method "write" on an undefined value at t\001lzma.t line 162. # Looks like you planned 5 tests but only ran 4. # Looks like your test died just after 4. t\001lzma.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 2/5 subtests Test Summary Report ------------------- t\001lzma.t (Wstat: 65280 Tests: 4 Failed: 1) Failed test: 3 Non-zero exit status: 255 Parse errors: Bad plan. You planned 5 tests but ran 4. Files=1, Tests=4, 0 wallclock secs ( 0.02 usr + 0.02 sys = 0.03 CPU) Result: FAIL
Subject: 0001-Portable-temp-dir-location.patch
From 0dc31082af29e65fdc2c121532c59315bb5c47e6 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson <doug@somethingdoug.com> Date: Fri, 28 Oct 2011 20:01:52 -0400 Subject: [PATCH] Portable temp dir location --- t/001lzma.t | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/t/001lzma.t b/t/001lzma.t index 2c6e2f7..2965e70 100644 --- a/t/001lzma.t +++ b/t/001lzma.t @@ -11,6 +11,7 @@ use strict; use warnings; use bytes; +use File::Spec ; use Test::More ; use CompTestUtils; @@ -154,7 +155,7 @@ EOM { title "$CompressClass"; #my $lex = new LexFile my $name ; - my $name = "/tmp/lz.lz"; + my $name = File::Spec->catfile(File::Spec->tmpdir, "lz.lz"); my $bz ; $bz = new IO::Compress::Lzma($name) or diag $IO::Compress::Lzma::LzmaError ; @@ -164,6 +165,7 @@ EOM #is myLzmaReadFile($name), $hello, " got expected content"; ok myLzmaReadFile($name) eq $hello, " got expected content"; + unlink $name; } # TODO - add filter tests -- 1.7.6.msysgit.0
Download (untitled) / with headers
text/plain 300b
Thanks again Doug. The file created in /tmp was a bit of debugging code I forgot to remove.The fix is to remove that line and uncomment the previuous line So #my $lex = new LexFile my $name ; my $name = "/tmp/lz.lz"; becomes my $lex = new LexFile my $name ; cheers Paul
Fixed version uploaded to CPAN
Download (untitled) / with headers
text/plain 481b
On Sat Oct 29 07:32:44 2011, PMQS wrote: Show quoted text
> Thanks again Doug. The file created in /tmp was a bit of debugging code > I forgot to remove.The fix is to remove that line and uncomment the > previuous line > > So > #my $lex = new LexFile my $name ; > my $name = "/tmp/lz.lz"; > > becomes > > my $lex = new LexFile my $name ; > > cheers > Paul
Ah, that would make sense why the rest was all commented out too. Version 2.041 now passes on Windows, thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.