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#line 18 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 GASP! A verbatim paragraph in NAME 27 28=unknown1 this is an unknown command with two N<unknownA> 29and D<unknownB> interior sequences. 30 31This is some paragraph text with some unknown interior sequences, 32such as Q<unknown2>, 33A<unknown3>, 34and Y<unknown4 V<unknown5>>. 35 36Now try some unterminated sequences like 37I<hello mudda! 38B<hello fadda! 39 40Here I am at C<camp granada! 41 42Camps is very, 43entertaining. 44And they say we'll have some fun if it stops raining! 45 46Okay, now use a non-empty blank line to terminate a paragraph and make 47sure we get a warning. 48 49The above blank line contains tabs and spaces only 50 51F<Many B<fcodes B<inside C<other I<fcodes F<inside I<many S<many C<more X<fcodes. S<This is X<ridiculous.>>>>>>>>>>>> 52 53A L<link|perlvar/$/> to L<perlvar/$E<sol>> 54 55=head1 Additional tests 56 57=head2 item without over 58 59=item oops 60 61=head2 back without over 62 63=back 64 65=head2 over without back 66 67=over 4 68 69=item aaps 70 71=head2 end without begin 72 73=end 74 75=end something 76 77=head2 begin and begin 78 79=begin html 80 81=begin text 82 83=end text 84 85=end html 86 87=head2 begin w/o formatter 88 89=begin 90 91=end 92 93=head2 for w/o formatter 94 95=for 96 97something... 98 99=head2 Nested sequences of the same type 100 101C<code I<italic C<code again!>>> 102 103=head2 Garbled entities 104 105E<alea iacta est> 106E<C<auml>> 107E<abcI<bla>> 108E<0x100> 109E<07777> 110E<300> 111E<unknown_entity> 112 113=head2 Unresolved internal links 114 115L</"begin or begin"> 116L<"end with begin"> 117L</OoPs> 118 119=head2 Some links with problems 120 121L<abc 122def> 123L<> 124L</> 125L<wheeee|/> 126L< aha> 127L<oho > 128L< weehee > 129L<"Warnings"> this one is ok 130L</unescaped> ok too, this POD has an X of the same name 131 132L<< lead >> 133L<< trail >> 134L<< neither >> 135L<<< both >>> 136 137L<<<<>>>> 138 139L<<<< >>>> 140 141L<<<< >>>> 142 143=head2 Warnings 144 145L<passwd(5)> 146L<some text with / in it|perlvar/$|> should give warnings as hell 147 148=over 4 149 150=item bla 151 152=back 200 153 154the 200 is evil 155 156X<unescaped>see these unescaped < and > in the text? 157 158=head2 Misc 159 160Z<ddd> should be empty 161 162X<> should not be empty 163 164X<0> should not generate a warning about being empty 165 166E<> should not be empty 167 168=over four 169 170This paragrapgh is misplaced - it ought to be an item. 171 172=item four should be numeric! 173 174=back 175 176=over 4 177 178=item 179 180=item blah 181 182=item previous is all empty!!! 183 184=back 185 186=over 187 188 This verbatim paragraph should not be here. Spaces are on the line below this 189 190=item * 191 192bullet 193 194=item 1 195 196number, uh oh 197 198=back 199 200=over 201 202=item * 203 204first bullet 205 206=item 1 207 208then number 209 210=item finally definition 211 212=back 213 214=over 215 216=item 1 217 218first number 219 220=item 3 221 222bad numbering 223 224=item then definition 225 226=item * 227 228finally bullet 229 230=back 231 232=over 233 234=item first defintion 235 236=item * 237 238then bullet 239 240=item 1 241 242finally number 243 244=item second definition 245 246 This should not generate an empty =item warning, 247 because it has verbatim text. 248 249=back 250 251Empty over/back: 252 253=over 4 254 255=over 2 256 257=back 258 259=back 260 261item w/o name 262 263=cut 264 265=pod bla 266 267bla is evil 268 269=cut blub 270 271blub is evil 272 273=head2 reoccurence 274 275=over 4 276 277=item Misc 278 279we already have a head Misc 280 281=back 282 283=head2 some heading 284 285=head2 another one 286 287previous section is empty! 288 289=head1 LINK TESTS 290 291 292 293 294 295 296 297 298 299 300L<perlop/"I/O Operators"> 301don't trigger a warning because node is quoted 302 303L<"I/O Operators"> 304incorrectly interpreted as 'O Operators in I', but this is deprecated syntax, as per perlpodspec. 305no warning due to quotes 306 307=head1 308 309Empty head above and unclosed over/begins below 310 311=head3 test X<stuff> I<test> 312 313=over 314 315=begin html 316 317What? 318 319=begin :xml 320 321L<This pod's NAME in a link means it is internal|poderrors.t/link_to_nowhere>, 322so should generate a warning 323 324=cut 325 326 327