summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Sabino Mullane2013-06-25 02:37:24 +0000
committerGreg Sabino Mullane2013-06-25 02:37:24 +0000
commit332996b2aca00485bf6568d05a752ed3b43bbe43 (patch)
tree4e8833cafa7cbaaace78a5ca098e7d723eb3426c
parentcc05424726a84f237806130ee453ead31d6a6089 (diff)
No tabs please.
-rw-r--r--t/05_docs.t50
1 files changed, 25 insertions, 25 deletions
diff --git a/t/05_docs.t b/t/05_docs.t
index 7adcf3181..7c7541a3f 100644
--- a/t/05_docs.t
+++ b/t/05_docs.t
@@ -25,62 +25,62 @@ if (!open $fh, '<', $file) {
close $fh or warn qq{Could not close "$file": $!\n};
if ($slurp !~ /\$action_info = (.+?)\}/s) {
- fail q{Could not find the 'action_info' section};
+ fail q{Could not find the 'action_info' section};
}
my $chunk = $1;
my @actions;
for my $line (split /\n/ => $chunk) {
- push @actions => $1 if $line =~ /^\s*(\w+)/;
+ push @actions => $1 if $line =~ /^\s*(\w+)/;
}
## Make sure each of those still exists as a subroutine
for my $action (@actions) {
- next if $action =~ /last_auto/;
+ next if $action =~ /last_auto/;
- my $match = $action;
- $match = 'pgb_pool' if $match =~ /pgb_pool/;
+ my $match = $action;
+ $match = 'pgb_pool' if $match =~ /pgb_pool/;
- if ($slurp !~ /\n\s*sub check_$match/) {
- fail qq{Could not find a check sub for the action '$action' ($match)!};
- }
+ if ($slurp !~ /\n\s*sub check_$match/) {
+ fail qq{Could not find a check sub for the action '$action' ($match)!};
+ }
}
pass 'Found matching check subroutines for each action inside of action_info';
## Make sure each check subroutine is documented
while ($slurp =~ /\n\s*sub check_(\w+)/g) {
- my $match = $1;
+ my $match = $1;
- ## Skip known exceptions:
- next if $match eq 'last_vacuum_analyze' or $match eq 'pgb_pool';
+ ## Skip known exceptions:
+ next if $match eq 'last_vacuum_analyze' or $match eq 'pgb_pool';
- if (! grep { $match eq $_ } @actions) {
- fail qq{The check subroutine check_$match was not found in the help!};
- }
+ if (! grep { $match eq $_ } @actions) {
+ fail qq{The check subroutine check_$match was not found in the help!};
+ }
}
pass 'Found matching help for each check subroutine';
## Make sure each item in the top help is in the POD
my @pods;
while ($slurp =~ /\n=head2 B<(\w+)>/g) {
- my $match = $1;
+ my $match = $1;
- ## Skip known exceptions:
- next if $match =~ /symlinks/;
+ ## Skip known exceptions:
+ next if $match =~ /symlinks/;
- if (! grep { $match eq $_ } @actions) {
- fail qq{The check subroutine check_$match was not found in the POD!};
- }
+ if (! grep { $match eq $_ } @actions) {
+ fail qq{The check subroutine check_$match was not found in the POD!};
+ }
- push @pods => $match;
+ push @pods => $match;
}
pass 'Found matching POD for each check subroutine';
## Make sure things are in the same order for both top (--help) and bottom (POD)
for my $action (@actions) {
- my $pod = shift @pods;
- if ($action ne $pod) {
- fail qq{Docs out of order: expected $action in POD section, but got $pod instead!};
- }
+ my $pod = shift @pods;
+ if ($action ne $pod) {
+ fail qq{Docs out of order: expected $action in POD section, but got $pod instead!};
+ }
}
pass 'POD actions appear in the correct order';