| 1 | BEGIN {
|
|---|
| 2 | use File::Basename;
|
|---|
| 3 | my $THISDIR = dirname $0;
|
|---|
| 4 | unshift @INC, $THISDIR;
|
|---|
| 5 | require "testpchk.pl";
|
|---|
| 6 | import TestPodChecker;
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | my %options = map { $_ => 1 } @ARGV; ## convert cmdline to options-hash
|
|---|
| 10 | my $passed = testpodchecker \%options, $0;
|
|---|
| 11 | exit( ($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 |
|
|---|
| 24 | poderrors.t - test Pod::Checker on some pod syntax errors
|
|---|
| 25 |
|
|---|
| 26 | =unknown1 this is an unknown command with two N<unknownA>
|
|---|
| 27 | and D<unknownB> interior sequences.
|
|---|
| 28 |
|
|---|
| 29 | This is some paragraph text with some unknown interior sequences,
|
|---|
| 30 | such as Q<unknown2>,
|
|---|
| 31 | A<unknown3>,
|
|---|
| 32 | and Y<unknown4 V<unknown5>>.
|
|---|
| 33 |
|
|---|
| 34 | Now try some unterminated sequences like
|
|---|
| 35 | I<hello mudda!
|
|---|
| 36 | B<hello fadda!
|
|---|
| 37 |
|
|---|
| 38 | Here I am at C<camp granada!
|
|---|
| 39 |
|
|---|
| 40 | Camps is very,
|
|---|
| 41 | entertaining.
|
|---|
| 42 | And they say we'll have some fun if it stops raining!
|
|---|
| 43 |
|
|---|
| 44 | Okay, now use a non-empty blank line to terminate a paragraph and make
|
|---|
| 45 | sure we get a warning.
|
|---|
| 46 |
|
|---|
| 47 | The 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 |
|
|---|
| 79 | second 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 |
|
|---|
| 91 | something...
|
|---|
| 92 |
|
|---|
| 93 | =head2 Nested sequences of the same type
|
|---|
| 94 |
|
|---|
| 95 | C<code I<italic C<code again!>>>
|
|---|
| 96 |
|
|---|
| 97 | =head2 Garbled entities
|
|---|
| 98 |
|
|---|
| 99 | E<alea iacta est>
|
|---|
| 100 | E<C<auml>>
|
|---|
| 101 | E<abcI<bla>>
|
|---|
| 102 | E<0x100>
|
|---|
| 103 | E<07777>
|
|---|
| 104 | E<300>
|
|---|
| 105 |
|
|---|
| 106 | =head2 Unresolved internal links
|
|---|
| 107 |
|
|---|
| 108 | L</"begin or begin">
|
|---|
| 109 | L<"end with begin">
|
|---|
| 110 | L</OoPs>
|
|---|
| 111 |
|
|---|
| 112 | =head2 Some links with problems
|
|---|
| 113 |
|
|---|
| 114 | L<abc
|
|---|
| 115 | def>
|
|---|
| 116 | L<>
|
|---|
| 117 | L< aha>
|
|---|
| 118 | L<oho >
|
|---|
| 119 | L<"Warnings"> this one is ok
|
|---|
| 120 | L</unescaped> ok too, this POD has an X of the same name
|
|---|
| 121 |
|
|---|
| 122 | =head2 Warnings
|
|---|
| 123 |
|
|---|
| 124 | L<passwd(5)>
|
|---|
| 125 | L<some text with / in it|perlvar/$|> should give warnings as hell
|
|---|
| 126 |
|
|---|
| 127 | =over 4
|
|---|
| 128 |
|
|---|
| 129 | =item bla
|
|---|
| 130 |
|
|---|
| 131 | =back 200
|
|---|
| 132 |
|
|---|
| 133 | the 200 is evil
|
|---|
| 134 |
|
|---|
| 135 | =begin html
|
|---|
| 136 |
|
|---|
| 137 | What?
|
|---|
| 138 |
|
|---|
| 139 | =end xml
|
|---|
| 140 |
|
|---|
| 141 | X<unescaped>see these unescaped < and > in the text?
|
|---|
| 142 |
|
|---|
| 143 | =head2 Misc
|
|---|
| 144 |
|
|---|
| 145 | Z<ddd> should be empty
|
|---|
| 146 |
|
|---|
| 147 | X<> should not be empty
|
|---|
| 148 |
|
|---|
| 149 | =over four
|
|---|
| 150 |
|
|---|
| 151 | This paragrapgh is misplaced - it ought to be an item.
|
|---|
| 152 |
|
|---|
| 153 | =item four should be numeric!
|
|---|
| 154 |
|
|---|
| 155 | =item
|
|---|
| 156 |
|
|---|
| 157 | =item blah
|
|---|
| 158 |
|
|---|
| 159 | =item previous is all empty!!!
|
|---|
| 160 |
|
|---|
| 161 | =back
|
|---|
| 162 |
|
|---|
| 163 | All empty over/back:
|
|---|
| 164 |
|
|---|
| 165 | =over 4
|
|---|
| 166 |
|
|---|
| 167 | =back
|
|---|
| 168 |
|
|---|
| 169 | item w/o name
|
|---|
| 170 |
|
|---|
| 171 | =cut
|
|---|
| 172 |
|
|---|
| 173 | =pod bla
|
|---|
| 174 |
|
|---|
| 175 | bla is evil
|
|---|
| 176 |
|
|---|
| 177 | =cut blub
|
|---|
| 178 |
|
|---|
| 179 | blub is evil
|
|---|
| 180 |
|
|---|
| 181 | =head2 reoccurence
|
|---|
| 182 |
|
|---|
| 183 | =over 4
|
|---|
| 184 |
|
|---|
| 185 | =item Misc
|
|---|
| 186 |
|
|---|
| 187 | we already have a head Misc
|
|---|
| 188 |
|
|---|
| 189 | =back
|
|---|
| 190 |
|
|---|
| 191 | =head2 some heading
|
|---|
| 192 |
|
|---|
| 193 | =head2 another one
|
|---|
| 194 |
|
|---|
| 195 | previous section is empty!
|
|---|
| 196 |
|
|---|
| 197 | =head1 LINK TESTS
|
|---|
| 198 |
|
|---|
| 199 | Due to bug reported by Rafael Garcia-Suarez "[email protected]":
|
|---|
| 200 |
|
|---|
| 201 | The following hyperlinks :
|
|---|
| 202 | L<"I/O Operators">
|
|---|
| 203 | L<perlop/"I/O Operators">
|
|---|
| 204 | trigger a podchecker warning (using bleadperl) :
|
|---|
| 205 | node 'I/O Operators' contains non-escaped | or /
|
|---|
| 206 |
|
|---|
| 207 | =cut
|
|---|
| 208 |
|
|---|
| 209 |
|
|---|