2 # $Id: man.t,v 1.5 2004/02/15 06:42:49 eagle Exp $
4 # man.t -- Additional specialized tests for Pod::Man.
6 # Copyright 2002, 2003, 2004 by Russ Allbery <rra@stanford.edu>
8 # This program is free software; you may redistribute it and/or modify it
9 # under the same terms as Perl itself.
13 if ($ENV{PERL_CORE}) {
16 unshift (@INC, '../blib/lib');
18 unshift (@INC, '../blib/lib');
24 print "not ok 1\n" unless $loaded;
34 next until $_ eq "###\n";
35 open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
37 last if $_ eq "###\n";
41 my $parser = Pod::Man->new or die "Cannot create parser\n";
42 $parser->parse_from_file ('tmp.pod', 'out.tmp');
44 open (OUT, 'out.tmp') or die "Cannot open out.tmp: $!\n";
45 while (<OUT>) { last if /^\.TH/ }
52 unlink ('tmp.pod', 'out.tmp');
55 last if $_ eq "###\n";
58 if ($output eq $expected) {
62 print "Expected\n========\n$expected\nOutput\n======\n$output\n";
67 # Below the marker are bits of POD and corresponding expected nroff output.
68 # This is used to test specific features or problems with Pod::Man. The input
69 # and output are separated by lines containing only ###.
76 gcc - GNU project C and C++ compiler
80 Other mentions of C++.
83 gcc \- GNU project C and C++ compiler
86 Other mentions of \*(C+.
92 This C<.> should be quoted.
96 This \f(CW\*(C`.\*(C'\fR should be quoted.
110 =item * Also a bullet.
145 Beyoncé! Beyoncé! Beyoncé!!
151 Older versions didn't convert Beyoncé in verbatim.
155 Beyonce\*'! Beyonce\*'! Beyonce\*'!!
158 \& Beyonce\*'! Beyonce\*'!
159 \& Beyonce\*'! Beyonce\*'!
160 \& Beyonce\*'! Beyonce\*'!
163 Older versions didn't convert Beyonce\*' in verbatim.
169 =item 1. Not a number
171 =item 2. Spaced right
183 .IP "1. Not a number" 4
184 .IX Item "1. Not a number"
186 .IP "2. Spaced right" 4
187 .IX Item "2. Spaced right"
188 .IP "1 Not a number" 2
189 .IX Item "1 Not a number"
190 .IP "2 Spaced right" 2
191 .IX Item "2 Spaced right"
214 The quotes should be converted in the above to paired quotes.
218 \&\*(L"=over ... =back\*(R"
222 The quotes should be converted in the above to paired quotes.
228 It cost me E<165>12345! That should be an X.
232 It cost me X12345! That should be an X.
238 Open E<agrave> la shell. Previous versions mapped it wrong.
242 Open a\*` la shell. Previous versions mapped it wrong.
263 .IX Item "First level"
276 =item 1. Check fonts in @CARP_NOT test.
280 .ie n .IP "1. Check fonts in @CARP_NOT test." 4
281 .el .IP "1. Check fonts in \f(CW@CARP_NOT\fR test." 4
282 .IX Item "1. Check fonts in @CARP_NOT test."
288 There should not be double quotes: L<C<< (?>pattern) >>>.
291 .IX Header "LINK QUOTING"
292 There should not be double quotes: \f(CW\*(C`(?>pattern)\*(C'\fR.
296 =head1 SE<lt>E<gt> MAGIC
298 Magic should be applied S<RISC OS> to that.
301 .IX Header "S<> MAGIC"
302 Magic should be applied \s-1RISC\s0\ \s-1OS\s0 to that.
308 These should be identical.
310 Bippity boppity boo "The
313 Bippity boppity boo "The
317 .IX Header "MAGIC MONEY"
318 These should be identical.
320 Bippity boppity boo \*(L"The
321 price is \f(CW$100\fR.\*(R"
323 Bippity boppity boo \*(L"The
324 price is \f(CW$100\fR.\*(R"
330 "Stuff" (no guesswork)
334 Oboy, is this C++ "fun" yet! (guesswork)
337 "Stuff" (no guesswork)
339 .IX Subsection "THINGS"
340 Oboy, is this \*(C+ \*(L"fun\*(R" yet! (guesswork)
344 =head1 Newline C Quote Weirdness
349 .SH "Newline C Quote Weirdness"
350 .IX Header "Newline C Quote Weirdness"
356 =head1 Soft Hypen Testing
360 JarkE<shy>ko HieE<shy>taE<shy>nieE<shy>mi
366 JarkE<173>ko HieE<173>taE<173>nieE<173>mi
372 JarkE<0x00AD>ko HieE<0x00AD>taE<0x00AD>nieE<0x00AD>mi
374 .SH "Soft Hypen Testing"
375 .IX Header "Soft Hypen Testing"
378 Jark\%ko Hie\%ta\%nie\%mi
384 Jark\%ko Hie\%ta\%nie\%mi
390 Jark\%ko Hie\%ta\%nie\%mi
394 =head1 XE<lt>E<gt> Whitespace
396 Blorpy L<B<prok>|blap> X<bivav> wugga chachacha.
399 .IX Header "X<> Whitespace"
400 Blorpy \fBprok\fR wugga chachacha.
405 =head1 Hyphen in SE<lt>E<gt>
407 Don't S<transform even-this hyphen>.
410 .IX Header "Hyphen in S<>"
411 Don't transform\ even-this\ hyphen.