Skip Menu |

This queue is for tickets about the Directory-Scratch CPAN distribution.

Report information
The Basics
Id: 24094
Status: resolved
Priority: 0/
Queue: Directory-Scratch

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

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



Subject: t/unit/ls.t fails on Win32 due to the hardcoded '/'
It should be '\\' on Win32. Attached patch would fix the problem. ---- C:\perl\.cpan\build\Directory-Scratch-0.10>prove -lv t/unit/l s.t t/unit/ls....1..13 ok 1 - created $tmp ok 2 - foo ok 3 - bar/baz ok 4 - bar/quux ok 5 - bar/baz/quux ok 6 - got 5 files under / ok 7 - check that paths agree ok 8 - got 5 files under / not ok 9 - check that paths agree # Failed test 'check that paths agree' # at t/unit/ls.t line 33. # Structures begin differing at: # $got->[0] = '\bar' # $expected->[0] = 'bar' ok 10 - no fake files [scalar] ok 11 - no fake files [list] ok 12 - single file = list ok 13 - got bar/baz/quux in bar/baz # Looks like you failed 1 test of 13. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 9 Failed 1/13 tests, 92.31% okay Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------ ------- t/unit/ls.t 1 256 13 1 9 Failed 1/1 test scripts. 1/13 subtests failed. Files=1, Tests=13, 2 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU) Failed 1/1 test programs. 1/13 subtests failed.
Subject: patch
Download patch
application/octet-stream 511b

Message body not shown because it is not plain text.

From: ISHIGAKI [...] cpan.org
Still broken with 0.11. As shown above, the contents of $dir (line:317) for the broken test is '\\'. So, $dir eq P::C::foreign_dir('Unix','/') doesn't work (it returns '/', the same as a hardcoded '/'). On 月曜日 12月 25 13:57:30 2006, ISHIGAKI wrote: Show quoted text
> It should be '\\' on Win32. Attached patch would fix the problem. > > ---- > > C:\perl\.cpan\build\Directory-Scratch-0.10>prove -lv t/unit/l > s.t > t/unit/ls....1..13 > ok 1 - created $tmp > ok 2 - foo > ok 3 - bar/baz > ok 4 - bar/quux > ok 5 - bar/baz/quux > ok 6 - got 5 files under / > ok 7 - check that paths agree > ok 8 - got 5 files under / > not ok 9 - check that paths agree > > # Failed test 'check that paths agree' > # at t/unit/ls.t line 33. > # Structures begin differing at: > # $got->[0] = '\bar' > # $expected->[0] = 'bar' > ok 10 - no fake files [scalar] > ok 11 - no fake files [list] > ok 12 - single file = list > ok 13 - got bar/baz/quux in bar/baz > # Looks like you failed 1 test of 13. > dubious > Test returned status 1 (wstat 256, 0x100) > DIED. FAILED test 9 > Failed 1/13 tests, 92.31% okay > Failed Test Stat Wstat Total Fail List of Failed > ----------------------------------------------------------------------
-- Show quoted text
> ------- > t/unit/ls.t 1 256 13 1 9 > Failed 1/1 test scripts. 1/13 subtests failed. > Files=1, Tests=13, 2 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 > CPU) > Failed 1/1 test programs. 1/13 subtests failed.
Subject: Re: [rt.cpan.org #24094] t/unit/ls.t fails on Win32 due to the hardcoded '/'
Date: Mon, 08 Jan 2007 14:20:46 -0600
To: bug-Directory-Scratch [...] rt.cpan.org
From: Jonathan Rockway <jon [...] jrock.us>
Show quoted text
> Queue: Directory-Scratch > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=24094 > > > Still broken with 0.11. As shown above, the contents of $dir (line:317) > for the broken test is '\\'. So, $dir eq P::C::foreign_dir('Unix','/') > doesn't work (it returns '/', the same as a hardcoded '/').
Ah, interesting. Can you send me a patch that works properly on Windows? If you do, I'll apply it and we can be rid of this problem :) Thanks, Jonathan Rockway
Here is the patch. diff -ur Directory-Scratch-0.11/lib/Directory/Scratch.pm Directory- Scratch-0.11-patched/lib/Directory/Scratch.pm --- Directory-Scratch-0.11/lib/Directory/Scratch.pm 2006-12-27 15:28:03.000000000 +0900 +++ Directory-Scratch-0.11-patched/lib/Directory/Scratch.pm 2007-01-09 12:23:13.684250000 +0900 @@ -314,7 +314,7 @@ } $short = $file if(!$dir || - $dir eq Path::Class::foreign_dir('Unix', '/')); + $dir eq dir('/')); #print {*STDERR} "[$base][$file: $short -> $full]\n";
From: JROCKWAY [...] cpan.org
Thanks; fixed in r171. A new release should be out shortly. On Mon Jan 08 22:36:02 2007, ISHIGAKI wrote: Show quoted text
> Here is the patch. > > diff -ur Directory-Scratch-0.11/lib/Directory/Scratch.pm Directory- > Scratch-0.11-patched/lib/Directory/Scratch.pm > --- Directory-Scratch-0.11/lib/Directory/Scratch.pm 2006-12-27 > 15:28:03.000000000 +0900 > +++ Directory-Scratch-0.11-patched/lib/Directory/Scratch.pm
2007-01-09 Show quoted text
> 12:23:13.684250000 +0900 > @@ -314,7 +314,7 @@ > } > > $short = $file if(!$dir || > - $dir eq
Path::Class::foreign_dir('Unix', '/')); Show quoted text
> + $dir eq dir('/')); > > #print {*STDERR} "[$base][$file: $short -> $full]\n"; >
-- Jonathan Rockway <jrockway@cpan.org>
0.12 on CPAN fixes this issue. I converted my ls method to use Path::Class's ls method, so the code ends up being cleaner too. -- Jonathan Rockway <jrockway@cpan.org>