This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
incorrectly failing test in lib/Pod/t/text.t
[perl5.git] / lib / Pod / t / basic.pod
CommitLineData
b616daaf
JH
1=head1 NAME
2
3basic.pod - Test of various basic POD features in translators.
4
5=head1 HEADINGS
6
7Try a few different levels of headings, with embedded formatting codes and
8other interesting bits.
9
10=head1 This C<is> a "level 1" heading
11
12=head2 ``Level'' "2 I<heading>
13
14=head3 Level 3 B<heading I<with C<weird F<stuff "" (double quote)>>>>
15
16=head4 Level "4 C<heading>
17
18Now try again with B<intermixed> F<text>.
19
20=head1 This C<is> a "level 1" heading
21
22Text.
23
24=head2 ``Level'' 2 I<heading>
25
26Text.
27
28=head3 Level 3 B<heading I<with C<weird F<stuff>>>>
29
30Text.
31
32=head4 Level "4 C<heading>
33
34Text.
35
36=head1 LINKS
37
38These are all taken from the Pod::Parser tests.
39
40Try out I<LOTS> of different ways of specifying references:
41
42Reference the L<manpage/section>
43
b616daaf
JH
44Reference the L<"manpage"/section>
45
46Reference the L<manpage/"section">
47
b616daaf
JH
48Now try it using the new "|" stuff ...
49
50Reference the L<thistext|manpage/section>|
51
52Reference the L<thistext | manpage / section>|
53
54Reference the L<thistext| manpage/ section>|
55
56Reference the L<thistext |manpage /section>|
57
b616daaf
JH
58Reference the L<thistext|manpage/"section">|
59
60Reference the L<thistext|
61manpage/
62section>|
63
b616daaf
JH
64And then throw in a few new ones of my own.
65
66L<foo>
67
68L<foo|bar>
69
70L<foo/bar>
71
72L<foo/"baz boo">
73
74L</bar>
75
76L</"baz boo">
77
78L</baz boo>
79
80L<foo bar/baz boo>
81
b616daaf
JH
82L<"boo var baz">
83
84L<bar baz>
85
b616daaf
JH
86L</boo>, L</bar>, and L</baz>
87
88L<fooZ<>bar>
89
90L<Testing I<italics>|foo/bar>
91
92L<foo/I<Italic> text>
93
94L<fooE<verbar>barZ<>/Section C<with> I<B<other> markup>>
95
96L<Nested L<http://www.perl.org/>|fooE<sol>bar>
97
98=head1 OVER AND ITEMS
99
100Taken from Pod::Parser tests, this is a test to ensure that multiline
101=item paragraphs get indented appropriately.
102
103=over 4
104
105=item This
106is
107a
108test.
109
110=back
111
112There should be whitespace now before this line.
113
114Taken from Pod::Parser tests, this is a test to ensure the nested =item
115paragraphs get indented appropriately.
116
117=over 2
118
119=item 1
120
121First section.
122
123=over 2
124
125=item a
126
127this is item a
128
129=item b
130
131this is item b
132
133=back
134
135=item 2
136
137Second section.
138
139=over 2
140
141=item a
142
143this is item a
144
145=item b
146
147this is item b
148
149=item c
150
151=item d
152
153This is item c & d.
154
155=back
156
157=back
158
159Now some additional weirdness of our own. Make sure that multiple tags
160for one paragraph are properly compacted.
161
162=over 4
163
164=item "foo"
165
166=item B<bar>
167
168=item C<baz>
169
170There shouldn't be any spaces between any of these item tags; this idiom
171is used in perlfunc.
172
173=item Some longer item text
174
175Just to make sure that we test paragraphs where the item text doesn't fit
176in the margin of the paragraph (and make sure that this paragraph fills a
177few lines).
178
179Let's also make it multiple paragraphs to be sure that works.
180
181=back
182
183Test use of =over without =item as a block "quote" or block paragraph.
184
185=over 4
186
187This should be indented four spaces but otherwise formatted the same as
188any other regular text paragraph. Make sure it's long enough to see the
189results of the formatting.....
190
191=back
192
193Now try the same thing nested, and make sure that the indentation is reset
194back properly.
195
196=over 4
197
198=over 4
199
200This paragraph should be doubly indented.
201
202=back
203
204This paragraph should only be singly indented.
205
206=over 4
207
208=item
209
210This is an item in the middle of a block-quote, which should be allowed.
211
212=item
213
214We're also testing tagless item commands.
215
216=back
217
218Should be back to the single level of indentation.
219
220=back
221
222Should be back to regular indentation.
223
224Now also check the transformation of * into real bullets for man pages.
225
226=over
227
228=item *
229
230An item. We're also testing using =over without a number, and making sure
231that item text wraps properly.
232
233=item *
234
235Another item.
236
237=back
238
239and now test the numbering of item blocks.
240
241=over 4
242
243=item 1.
244
245First item.
246
247=item 2.
248
249Second item.
250
251=back
252
253=head1 FORMATTING CODES
254
255Another test taken from Pod::Parser.
256
257This is a test to see if I can do not only C<$self> and C<method()>, but
258also C<< $self->method() >> and C<< $self->{FIELDNAME} >> and
259C<< $Foo <=> $Bar >> without resorting to escape sequences. If
260I want to refer to the right-shift operator I can do something
261like C<<< $x >> 3 >>> or even C<<<< $y >> 5 >>>>.
262
263Now for the grand finale of C<< $self->method()->{FIELDNAME} = {FOO=>BAR} >>.
264And I also want to make sure that newlines work like this
265C<<<
266$self->{FOOBAR} >> 3 and [$b => $a]->[$a <=> $b]
267>>>
268
269Of course I should still be able to do all this I<with> escape sequences
270too: C<$self-E<gt>method()> and C<$self-E<gt>{FIELDNAME}> and
271C<{FOO=E<gt>BAR}>.
272
273Dont forget C<$self-E<gt>method()-E<gt>{FIELDNAME} = {FOO=E<gt>BAR}>.
274
275And make sure that C<0> works too!
276
277Now, if I use << or >> as my delimiters, then I have to use whitespace.
278So things like C<<$self->method()>> and C<<$self->{FIELDNAME}>> wont end
279up doing what you might expect since the first > will still terminate
280the first < seen.
281
282Lets make sure these work for empty ones too, like C<< >> and C<< >> >>
283(just to be obnoxious)
284
285The statement: C<This is dog kind's I<finest> hour!> is a parody of a
286quotation from Winston Churchill.
287
288The following tests are added to those:
289
290Make sure that a few othZ<>er odd I<Z<>things> still work. This should be
291a vertical bar: E<verbar>. Here's a test of a few more special escapes
292that have to be supported:
293
294=over 3
295
296=item E<amp>
297
298An ampersand.
299
300=item E<apos>
301
302An apostrophe.
303
304=item E<lt>
305
306A less-than sign.
307
308=item E<gt>
309
310A greater-than sign.
311
312=item E<quot>
313
314A double quotation mark.
315
316=item E<sol>
317
318A forward slash.
319
320=back
321
322Try to get this bit of text over towards the edge so S<|that all of this
323text inside SE<lt>E<gt> won't|> be wrapped. Also test the
324|sameE<nbsp>thingE<nbsp>withE<nbsp>non-breakingS< spaces>.|
325
326There is a soft hyE<shy>phen in hyphen at hy-phen.
327
328This is a test of an X<index entry>index entry.
329
330=head1 VERBATIM
331
332Throw in a few verbatim paragraphs.
333
334 use Term::ANSIColor;
335 print color 'bold blue';
336 print "This text is bold blue.\n";
337 print color 'reset';
338 print "This text is normal.\n";
339 print colored ("Yellow on magenta.\n", 'yellow on_magenta');
340 print "This text is normal.\n";
341 print colored ['yellow on_magenta'], "Yellow on magenta.\n";
342
343 use Term::ANSIColor qw(uncolor);
344 print uncolor '01;31', "\n";
345
346But this isn't verbatim (make sure it wraps properly), and the next
347paragraph is again:
348
349 use Term::ANSIColor qw(:constants);
350 print BOLD, BLUE, "This text is in bold blue.\n", RESET;
351
352 use Term::ANSIColor qw(:constants); $Term::ANSIColor::AUTORESET = 1; print BOLD BLUE "This text is in bold blue.\n"; print "This text is normal.\n";
353
354(Ugh, that's obnoxiously long.) Try different spacing:
355
356 Starting with a tab.
357Not
358starting
359with
360a
361tab. But this should still be verbatim.
362 As should this.
363
364This isn't.
365
366 This is. And this: is an internal tab. It should be:
367 |--| <= lined up with that.
368
369(Tricky, but tabs should be expanded before the translator starts in on
370the text since otherwise text with mixed tabs and spaces will get messed
371up.)
372
2da3dd12
AMS
373 And now we test verbatim paragraphs right before a heading. Older
374 versions of Pod::Man generated two spaces between paragraphs like this
375 and the heading. (In order to properly test this, one may have to
376 visually inspect the nroff output when run on the generated *roff
377 text, unfortunately.)
378
379=head1 CONCLUSION
380
381That's all, folks!
382
b616daaf 383=cut