1BEGIN { 2 use File::Basename; 3 my $THISDIR = dirname $0; 4 unshift @INC, $THISDIR; 5 require "testpchk.pl"; 6 import TestPodChecker; 7} 8 9my %options = map { $_ => 1 } @ARGV; ## convert cmdline to options-hash 10my $passed = testpodchecker \%options, $0; 11exit( ($passed == 1) ? 0 : -1 ) unless $ENV{HARNESS_ACTIVE}; 12 13### Deliberately throw in some blank but non-empty lines 14 15### The above line should contain spaces 16 17 18__END__ 19 20=head2 This should cause a warning 21 22=head1 NAME 23 24poderrors.t - test Pod::Checker on some pod syntax errors 25 26=unknown1 this is an unknown command with two N<unknownA> 27and D<unknownB> interior sequences. 28 29This is some paragraph text with some unknown interior sequences, 30such as Q<unknown2>, 31A<unknown3>, 32and Y<unknown4 V<unknown5>>. 33 34Now try some unterminated sequences like 35I<hello mudda! 36B<hello fadda! 37 38Here I am at C<camp granada! 39 40Camps is very, 41entertaining. 42And they say we'll have some fun if it stops raining! 43 44Okay, now use a non-empty blank line to terminate a paragraph and make 45sure we get a warning. 46 47The above blank line contains tabs and spaces only 48 49=head1 Additional tests 50 51=head2 item without over 52 53=item oops 54 55=head2 back without over 56 57=back 58 59=head2 over without back 60 61=over 4 62 63=item aaps 64 65=head2 end without begin 66 67=end 68 69=head2 begin and begin 70 71=begin html 72 73=begin text 74 75=end 76 77=end 78 79second one results in end w/o begin 80 81=head2 begin w/o formatter 82 83=begin 84 85=end 86 87=head2 for w/o formatter 88 89=for 90 91something... 92 93=head2 Nested sequences of the same type 94 95C<code I<italic C<code again!>>> 96 97=head2 Garbled entities 98 99E<alea iacta est> 100E<C<auml>> 101E<abcI<bla>> 102E<0x100> 103E<07777> 104E<300> 105 106=head2 Unresolved internal links 107 108L</"begin or begin"> 109L<"end with begin"> 110L</OoPs> 111 112=head2 Some links with problems 113 114L<abc 115def> 116L<> 117L< aha> 118L<oho > 119L<"Warnings"> this one is ok 120L</unescaped> ok too, this POD has an X of the same name 121L<http://www.perl.org> this is OK 122L<The Perl Home Page|http://www.perl.org> this is also OK 123 124=head2 Warnings 125 126L<passwd(5)> 127L<some text with / in it|perlvar/$|> should give warnings as hell 128 129=over 4 130 131=item bla 132 133=back 200 134 135the 200 is evil 136 137=begin html 138 139What? 140 141=end xml 142 143X<unescaped>see these unescaped < and > in the text? 144 145=head2 Misc 146 147Z<ddd> should be empty 148 149X<> should not be empty 150 151=over four 152 153This paragrapgh is misplaced - it ought to be an item. 154 155=item four should be numeric! 156 157=item 158 159=item blah 160 161=item previous is all empty!!! 162 163=back 164 165All empty over/back: 166 167=over 4 168 169=back 170 171item w/o name 172 173=cut 174 175=pod bla 176 177bla is evil 178 179=cut blub 180 181blub is evil 182 183=head2 reoccurence 184 185=over 4 186 187=item Misc 188 189we already have a head Misc 190 191=back 192 193=head2 some heading 194 195=head2 another one 196 197=head2 the next line should be empty 198=head2 ... but there is a command instead 199 200And here is some text 201=head2 again followed by a command 202 203 verbatim 204=item line missing 205 206previous section is empty! 207 208=head1 LINK TESTS 209 210Due to bug reported by Rafael Garcia-Suarez "rgarciasuarez@free.fr": 211 212The following hyperlinks : 213L<"I/O Operators"> 214L<perlop/"I/O Operators"> 215trigger a podchecker warning (using bleadperl) : 216 node 'I/O Operators' contains non-escaped | or / 217 218=cut 219 220=pod 221 222=head1 ON-OFF tests 223 224The above =pod is OK. The following =cut is ok, the one after not. 225 226=cut 227 228# some comment or code here, not POD 229 230=cut 231 232# more code 233 234=head2 This opens POD 235 236=pod 237 238And the =pod above is too much. 239 240=cut 241 242