Subject: | "prove test_with_spaces" is broken on win32 |
I noticed that while testing "Run this test" in Padre that prove
file_name_with_space does not work at all. After tracing the problem it
turned out that in App::Prove::State Perl's glob is being used as
follows:
# Do globbing on Win32.
@argv = map { glob "$_" } @argv if NEED_GLOB;
glob is broken on win32, and thus one should use
File::Glob::Windows::glob instead.
It works when I change it to the following:
# Do globbing on Win32.
use File::Glob::Windows;
@argv = map { glob "$_" } @argv if NEED_GLOB;
Below is what happened to made me conclude this result:
-------------------------------------------------------
C:\>dir "c:\Documents and Settings\azawawi\My Documents\test.t"
Volume in drive C has no label.
Volume Serial Number is ********
Directory of c:\Documents and Settings\azawawi\My Documents
09/16/2009 11:31 AM 105 test.t
1 File(s) 105 bytes
C:\>type "c:\Documents and Settings\azawawi\My Documents\test.t"
#!/usr/bin/perl
use 5.006;
use strict;
use warnings;
use Test::More tests => 1;
ok( 1, 'Dummy Test' );
C:\>prove "c:\Documents and Settings\azawawi\My Documents\test.t"
Cannot determine source for c:./Documents at
C:/strawberry/perl/lib/App/Prove.pm line 496
C:\>prove 'c:\Documents and Settings\azawawi\My Documents\test.t'
Cannot determine source for 'c:\Documents at
C:/strawberry/perl/lib/App/Prove.pm line 496
C:\>prove c:\Documents and Settings\azawawi\My Documents\test.t
Cannot determine source for c:\Documents at
C:/strawberry/perl/lib/App/Prove.pm line 496
Show quoted text
-------------------- Making it work ----------------------------------
C:\>copy "c:\Documents and Settings\azawawi\My Documents\test.t" d:\to
ols\test.t
1 file(s) copied.
C:\>prove d:\tools\test.t
d:\tools\test.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.05 usr + 0.02 sys = 0.06 CPU)
Result: PASS