To: | Andy Lester <andy [...] petdance.com> |
Subject: | Pod-Test-1.08: failure in make test: portability issue in Win32 |
From: | Adriano Rodrigues Ferreira <ferreira [...] triang.com.br> |
Date: | Wed, 21 Jan 2004 13:39:03 -0200 |
Dear Andy,
I found that 'cpan' fails to install Pod-Test-1.08 in my Windows 2000
machine due to a minor issue in the test script "t/all_pod_files.t".
The following code
my $tpod = File::Spec->catfile( qw( t pod ) );
my @files = Test::Pod::all_pod_files( "blib", $tpod );
# The expected files have slashes, not File::Spec separators, because
# that's how File::Find does it.
my @expected = qw(
blib/lib/Test/Pod.pm
t/pod/good.pod
t/pod/no_pod.pod
);
fails with output
1..2
ok 1 - use Test::Pod;
not ok 2 - Got all the distro files
# Failed test (t\all_pod_files.t at line 23)
# Structures begin differing at:
# $got->[1] = 't\pod/good.pod'
# $expected->[1] = 't/pod/good.pod'
# Looks like you failed 1 tests of 2.
The point is that C<File::Spec->catfile( qw( t pod ) )> turn into 't\pod'
in Windows (as it is supposed to do)
but File::Find does not mind to use slashes all the way. That is, when
't\pod' is given to File::Find,
it goes on appending to this path, now with slashes. And then
't\pod/good.pod'.
The solution is immediate. If the first line of the mentioned code is
written simply as
my $tpod = "t/pod";
it works. Perl (even in Windoze machines) handle very well slashes and
backslashes. Who does not do it well are Windows utilities (nmake, etc.).
If you accept this solution, the "use File::Spec" can be removed too.
Maybe the problem is that I am not getting a big picture for which the use
File::Spec is really important.
From my superficial point-of-view, the use of File::Spec in your test
scripts is generally unnecessary (at least in the Windows port of perl).
Best regards,
Adriano
Adriano R. Ferreira
Oasis Comunicacao e Tecnologia Ltda.
--
We don't need no stinking Java. We want to get some fun.