Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Pod CPAN distribution.

Report information
The Basics
Id: 33025
Status: resolved
Priority: 0/
Queue: Test-Pod

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

Bug Information
Severity: Normal
Broken in: 1.26
Fixed in: 1.42



Subject: all_pod_files_ok does not operate on directories
The documentation for your module reads: all_pod_files_ok( [@files/@directories] ) Checks all the files in @files for valid POD. It runs all_pod_files() on each file/directory, and calls the "plan()" function for you (one test for each function), so you can’t have already called "plan". It works correctly when specifying a list of files - But it does not call all_pod_files if what it receives is a directory. The attached patch will follow the mentioned directories.
Subject: test-pod.diff
Index: Pod.pm =================================================================== --- Pod.pm (revision 14629) +++ Pod.pm (working copy) @@ -150,7 +150,20 @@ =cut sub all_pod_files_ok { - my @files = @_ ? @_ : all_pod_files(); + my (@files); + if (@_) { + for my $entry (@_) { + if ( -d $entry ) { + push @files, all_pod_files($entry); + } elsif ( -f $entry or -l $entry ) { + push @files, $entry; + } else { + $Test->diag( "$entry does not exist" ); + } + } + } else { + @files = all_pod_files(); + } $Test->plan( tests => scalar @files );
Forgot to mention: This bug report is a followup for Debian's BTS: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=463770
Subject: [rt.cpan.org #33025] all_pod_files_ok does not operate on directories
Date: Sun, 13 Apr 2008 15:50:01 -0300
To: bug-test-pod <bug-test-pod [...] rt.cpan.org>, "Andy Lester" <andy [...] petdance.com>
From: "Adriano Ferreira" <a.r.ferreira [...] gmail.com>
Hi, Andy. This is an alternative patch to get right the "all_pod_files_ok" when given arguments are directories. Currently, the usage of this function must be all_pod_files_ok(); # which expands to all_pod_files_ok(all_pod_files) or all_pod_files_ok(@files) Trying to pass directory arguments do not work: all_pod_files_ok('lib') will say 1..1 not ok 1 - lib # Failed test 'lib' # at /usr/local/share/perl/5.8.8/Test/Pod.pm line 159. # lib does not exist # Looks like you failed 1 test of 1. The given patch fixes that so mixed files and directories as arguments for all_pod_files_ok() will work. So, usages like: all_pod_files_ok(all_pod_files(qw( lib bin )); will simplify to just all_pod_files_ok(qw(lib bin )); The patch also adds some touches to POD trying to make documentation more precise. Best, Adriano Ferreira

Message body is not shown because sender requested not to inline it.

Committed, thanks: http://github.com/theory/test-pod/commit/a39db65edeadfab875afe88c27a7aaec896b97d4 New version later today. Best, David