xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/t/pod/poderrs.t (revision 0:68f95e015346)
1*0Sstevel@tonic-gateBEGIN {
2*0Sstevel@tonic-gate   use File::Basename;
3*0Sstevel@tonic-gate   my $THISDIR = dirname $0;
4*0Sstevel@tonic-gate   unshift @INC, $THISDIR;
5*0Sstevel@tonic-gate   require "testpchk.pl";
6*0Sstevel@tonic-gate   import TestPodChecker;
7*0Sstevel@tonic-gate}
8*0Sstevel@tonic-gate
9*0Sstevel@tonic-gatemy %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
10*0Sstevel@tonic-gatemy $passed  = testpodchecker \%options, $0;
11*0Sstevel@tonic-gateexit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};
12*0Sstevel@tonic-gate
13*0Sstevel@tonic-gate### Deliberately throw in some blank but non-empty lines
14*0Sstevel@tonic-gate
15*0Sstevel@tonic-gate### The above line should contain spaces
16*0Sstevel@tonic-gate
17*0Sstevel@tonic-gate
18*0Sstevel@tonic-gate__END__
19*0Sstevel@tonic-gate
20*0Sstevel@tonic-gate=head2 This should cause a warning
21*0Sstevel@tonic-gate
22*0Sstevel@tonic-gate=head1 NAME
23*0Sstevel@tonic-gate
24*0Sstevel@tonic-gatepoderrors.t - test Pod::Checker on some pod syntax errors
25*0Sstevel@tonic-gate
26*0Sstevel@tonic-gate=unknown1 this is an unknown command with two N<unknownA>
27*0Sstevel@tonic-gateand D<unknownB> interior sequences.
28*0Sstevel@tonic-gate
29*0Sstevel@tonic-gateThis is some paragraph text with some unknown interior sequences,
30*0Sstevel@tonic-gatesuch as Q<unknown2>,
31*0Sstevel@tonic-gateA<unknown3>,
32*0Sstevel@tonic-gateand Y<unknown4 V<unknown5>>.
33*0Sstevel@tonic-gate
34*0Sstevel@tonic-gateNow try some unterminated sequences like
35*0Sstevel@tonic-gateI<hello mudda!
36*0Sstevel@tonic-gateB<hello fadda!
37*0Sstevel@tonic-gate
38*0Sstevel@tonic-gateHere I am at C<camp granada!
39*0Sstevel@tonic-gate
40*0Sstevel@tonic-gateCamps is very,
41*0Sstevel@tonic-gateentertaining.
42*0Sstevel@tonic-gateAnd they say we'll have some fun if it stops raining!
43*0Sstevel@tonic-gate
44*0Sstevel@tonic-gateOkay, now use a non-empty blank line to terminate a paragraph and make
45*0Sstevel@tonic-gatesure we get a warning.
46*0Sstevel@tonic-gate
47*0Sstevel@tonic-gateThe above blank line contains tabs and spaces only
48*0Sstevel@tonic-gate
49*0Sstevel@tonic-gate=head1 Additional tests
50*0Sstevel@tonic-gate
51*0Sstevel@tonic-gate=head2 item without over
52*0Sstevel@tonic-gate
53*0Sstevel@tonic-gate=item oops
54*0Sstevel@tonic-gate
55*0Sstevel@tonic-gate=head2 back without over
56*0Sstevel@tonic-gate
57*0Sstevel@tonic-gate=back
58*0Sstevel@tonic-gate
59*0Sstevel@tonic-gate=head2 over without back
60*0Sstevel@tonic-gate
61*0Sstevel@tonic-gate=over 4
62*0Sstevel@tonic-gate
63*0Sstevel@tonic-gate=item aaps
64*0Sstevel@tonic-gate
65*0Sstevel@tonic-gate=head2 end without begin
66*0Sstevel@tonic-gate
67*0Sstevel@tonic-gate=end
68*0Sstevel@tonic-gate
69*0Sstevel@tonic-gate=head2 begin and begin
70*0Sstevel@tonic-gate
71*0Sstevel@tonic-gate=begin html
72*0Sstevel@tonic-gate
73*0Sstevel@tonic-gate=begin text
74*0Sstevel@tonic-gate
75*0Sstevel@tonic-gate=end
76*0Sstevel@tonic-gate
77*0Sstevel@tonic-gate=end
78*0Sstevel@tonic-gate
79*0Sstevel@tonic-gatesecond one results in end w/o begin
80*0Sstevel@tonic-gate
81*0Sstevel@tonic-gate=head2 begin w/o formatter
82*0Sstevel@tonic-gate
83*0Sstevel@tonic-gate=begin
84*0Sstevel@tonic-gate
85*0Sstevel@tonic-gate=end
86*0Sstevel@tonic-gate
87*0Sstevel@tonic-gate=head2 for w/o formatter
88*0Sstevel@tonic-gate
89*0Sstevel@tonic-gate=for
90*0Sstevel@tonic-gate
91*0Sstevel@tonic-gatesomething...
92*0Sstevel@tonic-gate
93*0Sstevel@tonic-gate=head2 Nested sequences of the same type
94*0Sstevel@tonic-gate
95*0Sstevel@tonic-gateC<code I<italic C<code again!>>>
96*0Sstevel@tonic-gate
97*0Sstevel@tonic-gate=head2 Garbled entities
98*0Sstevel@tonic-gate
99*0Sstevel@tonic-gateE<alea iacta est>
100*0Sstevel@tonic-gateE<C<auml>>
101*0Sstevel@tonic-gateE<abcI<bla>>
102*0Sstevel@tonic-gateE<0x100>
103*0Sstevel@tonic-gateE<07777>
104*0Sstevel@tonic-gateE<300>
105*0Sstevel@tonic-gate
106*0Sstevel@tonic-gate=head2 Unresolved internal links
107*0Sstevel@tonic-gate
108*0Sstevel@tonic-gateL</"begin or begin">
109*0Sstevel@tonic-gateL<"end with begin">
110*0Sstevel@tonic-gateL</OoPs>
111*0Sstevel@tonic-gate
112*0Sstevel@tonic-gate=head2 Some links with problems
113*0Sstevel@tonic-gate
114*0Sstevel@tonic-gateL<abc
115*0Sstevel@tonic-gatedef>
116*0Sstevel@tonic-gateL<>
117*0Sstevel@tonic-gateL<   aha>
118*0Sstevel@tonic-gateL<oho   >
119*0Sstevel@tonic-gateL<"Warnings"> this one is ok
120*0Sstevel@tonic-gateL</unescaped> ok too, this POD has an X of the same name
121*0Sstevel@tonic-gate
122*0Sstevel@tonic-gate=head2 Warnings
123*0Sstevel@tonic-gate
124*0Sstevel@tonic-gateL<passwd(5)>
125*0Sstevel@tonic-gateL<some text with / in it|perlvar/$|> should give warnings as hell
126*0Sstevel@tonic-gate
127*0Sstevel@tonic-gate=over 4
128*0Sstevel@tonic-gate
129*0Sstevel@tonic-gate=item bla
130*0Sstevel@tonic-gate
131*0Sstevel@tonic-gate=back 200
132*0Sstevel@tonic-gate
133*0Sstevel@tonic-gatethe 200 is evil
134*0Sstevel@tonic-gate
135*0Sstevel@tonic-gate=begin html
136*0Sstevel@tonic-gate
137*0Sstevel@tonic-gateWhat?
138*0Sstevel@tonic-gate
139*0Sstevel@tonic-gate=end xml
140*0Sstevel@tonic-gate
141*0Sstevel@tonic-gateX<unescaped>see these unescaped < and > in the text?
142*0Sstevel@tonic-gate
143*0Sstevel@tonic-gate=head2 Misc
144*0Sstevel@tonic-gate
145*0Sstevel@tonic-gateZ<ddd> should be empty
146*0Sstevel@tonic-gate
147*0Sstevel@tonic-gateX<> should not be empty
148*0Sstevel@tonic-gate
149*0Sstevel@tonic-gate=over four
150*0Sstevel@tonic-gate
151*0Sstevel@tonic-gateThis paragrapgh is misplaced - it ought to be an item.
152*0Sstevel@tonic-gate
153*0Sstevel@tonic-gate=item four should be numeric!
154*0Sstevel@tonic-gate
155*0Sstevel@tonic-gate=item
156*0Sstevel@tonic-gate
157*0Sstevel@tonic-gate=item blah
158*0Sstevel@tonic-gate
159*0Sstevel@tonic-gate=item previous is all empty!!!
160*0Sstevel@tonic-gate
161*0Sstevel@tonic-gate=back
162*0Sstevel@tonic-gate
163*0Sstevel@tonic-gateAll empty over/back:
164*0Sstevel@tonic-gate
165*0Sstevel@tonic-gate=over 4
166*0Sstevel@tonic-gate
167*0Sstevel@tonic-gate=back
168*0Sstevel@tonic-gate
169*0Sstevel@tonic-gateitem w/o name
170*0Sstevel@tonic-gate
171*0Sstevel@tonic-gate=cut
172*0Sstevel@tonic-gate
173*0Sstevel@tonic-gate=pod bla
174*0Sstevel@tonic-gate
175*0Sstevel@tonic-gatebla is evil
176*0Sstevel@tonic-gate
177*0Sstevel@tonic-gate=cut blub
178*0Sstevel@tonic-gate
179*0Sstevel@tonic-gateblub is evil
180*0Sstevel@tonic-gate
181*0Sstevel@tonic-gate=head2 reoccurence
182*0Sstevel@tonic-gate
183*0Sstevel@tonic-gate=over 4
184*0Sstevel@tonic-gate
185*0Sstevel@tonic-gate=item Misc
186*0Sstevel@tonic-gate
187*0Sstevel@tonic-gatewe already have a head Misc
188*0Sstevel@tonic-gate
189*0Sstevel@tonic-gate=back
190*0Sstevel@tonic-gate
191*0Sstevel@tonic-gate=head2 some heading
192*0Sstevel@tonic-gate
193*0Sstevel@tonic-gate=head2 another one
194*0Sstevel@tonic-gate
195*0Sstevel@tonic-gateprevious section is empty!
196*0Sstevel@tonic-gate
197*0Sstevel@tonic-gate=head1 LINK TESTS
198*0Sstevel@tonic-gate
199*0Sstevel@tonic-gateDue to bug reported by Rafael Garcia-Suarez "rgarciasuarez@free.fr":
200*0Sstevel@tonic-gate
201*0Sstevel@tonic-gateThe following hyperlinks :
202*0Sstevel@tonic-gateL<"I/O Operators">
203*0Sstevel@tonic-gateL<perlop/"I/O Operators">
204*0Sstevel@tonic-gatetrigger a podchecker warning (using bleadperl) :
205*0Sstevel@tonic-gate    node 'I/O Operators' contains non-escaped | or /
206*0Sstevel@tonic-gate
207*0Sstevel@tonic-gate=cut
208*0Sstevel@tonic-gate
209*0Sstevel@tonic-gate
210