In perl.git, the branch smoke-me/Pod-Functions has been updated <http://perl5.git.perl.org/perl.git/commitdiff/7d96fc23cc45a33f7412d0bc1635bd7f88cd899a?hp=73b1295a1a3383cf59d3c74806b94fd97785e494>
- Log ----------------------------------------------------------------- commit 7d96fc23cc45a33f7412d0bc1635bd7f88cd899a Author: Nicholas Clark <[email protected]> Date: Mon Jan 30 18:41:54 2012 +0100 Test that every function in perlfunc.pod has a summary for Pod::Functions. Historically Pod::Functions has failed to get updated when functions are added. This should solve that. ----------------------------------------------------------------------- Summary of changes: ext/Pod-Functions/Functions_pm.PL | 23 ++++++++++++++++++----- t/porting/perlfunc.t | 3 ++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ext/Pod-Functions/Functions_pm.PL b/ext/Pod-Functions/Functions_pm.PL index c6730fb..5320771 100644 --- a/ext/Pod-Functions/Functions_pm.PL +++ b/ext/Pod-Functions/Functions_pm.PL @@ -2,7 +2,7 @@ use strict; use Pod::Simple::SimpleTree; -my ($tap, $test); +my ($tap, $test, %Missing); @ARGV = grep { not($_ eq '--tap' and $tap = 1) } @ARGV; @@ -29,6 +29,7 @@ foreach my $TL_node (@$tree[2 .. $#$tree]) { if ($TL_node->[$i+1][0] ne 'for' || $TL_node->[$i+1][1]{target} ne 'Pod::Functions') { ++$i; + ++$Missing{$item_text}; next; } my $data = $TL_node->[$i+1][2]; @@ -84,11 +85,23 @@ sub sort_funcs { } if ($tap) { - foreach my $func (sort_funcs(keys %Flavor)) { - ++$test; - my $ok = $Type{$func} ? 'ok' : 'not ok'; - print "$ok $test - $func is mentioned in at least one category group\n"; + foreach (sort keys %Missing) { + # Ignore anything that looks like an alternative for a function we've + # already seen; + next if $Flavor{s!(?: [A-Z].*| \(\)|\( LIST \)| /PATTERN/.*)!!r}; + next if / in perl5$/; # RT #109408 + ++$test; + if (/^[_a-z]/) { + print "not ok $test - function '$_' has no summary for Pod::Functions\n"; + } else { + print "not ok $test - section '$_' has no type for Pod::Functions\n"; + } } + foreach my $func (sort_funcs(keys %Flavor)) { + ++$test; + my $ok = $Type{$func} ? 'ok' : 'not ok'; + print "$ok $test - $func is mentioned in at least one category group\n"; + } print "1..$test\n"; exit; } diff --git a/t/porting/perlfunc.t b/t/porting/perlfunc.t index b32e88a..fb0209d 100644 --- a/t/porting/perlfunc.t +++ b/t/porting/perlfunc.t @@ -18,7 +18,8 @@ # It's broken - how do I fix it? # Likely it's because you changed something in pod/perlfunc.pod # If you added a new function, it needs to be added to one or more groups in -# "Perl Functions by Category". +# "Perl Functions by Category", and to have a one line summary for +# Pod::Functions provided by a =for directive. BEGIN { @INC = '..' if -f '../TestInit.pm'; -- Perl5 Master Repository
