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< aha> 125L<oho > 126L< weehee > 127L<"Warnings"> this one is ok 128L</unescaped> ok too, this POD has an X of the same name 129 130L<< lead >> 131L<< trail >> 132L<< neither >> 133L<<< both >>> 134 135L<<<<>>>> 136 137L<<<< >>>> 138 139L<<<< >>>> 140 141=head2 Warnings 142 143L<passwd(5)> 144L<some text with / in it|perlvar/$|> should give warnings as hell 145 146=over 4 147 148=item bla 149 150=back 200 151 152the 200 is evil 153 154X<unescaped>see these unescaped < and > in the text? 155 156=head2 Misc 157 158Z<ddd> should be empty 159 160X<> should not be empty 161 162X<0> should not generate a warning about being empty 163 164E<> should not be empty 165 166=over four 167 168This paragrapgh is misplaced - it ought to be an item. 169 170=item four should be numeric! 171 172=back 173 174=over 4 175 176=item 177 178=item blah 179 180=item previous is all empty!!! 181 182=back 183 184=over 185 186 This verbatim paragraph should not be here. Spaces are on the line below this 187 188=item * 189 190bullet 191 192=item 1 193 194number, uh oh 195 196=back 197 198=over 199 200=item * 201 202first bullet 203 204=item 1 205 206then number 207 208=item finally definition 209 210=back 211 212=over 213 214=item 1 215 216first number 217 218=item 3 219 220bad numbering 221 222=item then definition 223 224=item * 225 226finally bullet 227 228=back 229 230=over 231 232=item first defintion 233 234=item * 235 236then bullet 237 238=item 1 239 240finally number 241 242=item second definition 243 244 This should not generate an empty =item warning, 245 because it has verbatim text. 246 247=back 248 249Empty over/back: 250 251=over 4 252 253=over 2 254 255=back 256 257=back 258 259item w/o name 260 261=cut 262 263=pod bla 264 265bla is evil 266 267=cut blub 268 269blub is evil 270 271=head2 reoccurence 272 273=over 4 274 275=item Misc 276 277we already have a head Misc 278 279=back 280 281=head2 some heading 282 283=head2 another one 284 285previous section is empty! 286 287=head1 LINK TESTS 288 289 290 291 292 293 294 295 296 297 298L<perlop/"I/O Operators"> 299don't trigger a warning because node is quoted 300 301L<"I/O Operators"> 302incorrectly interpreted as 'O Operators in I', but this is deprecated syntax, as per perlpodspec. 303no warning due to quotes 304 305=head1 306 307Empty head above and unclosed over/begins below 308 309=head3 test X<stuff> I<test> 310 311=over 312 313=begin html 314 315What? 316 317=begin :xml 318 319L<This pod's NAME in a link means it is internal|poderrors.t/link_to_nowhere>, 320so should generate a warning 321 322=cut 323 324 325