2 # $Id: text-options.t,v 1.4 2004/12/31 21:29:34 eagle Exp $
4 # text-options.t -- Additional tests for Pod::Text options.
6 # Copyright 2002, 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;
35 next until $_ eq "###\n";
37 last if $_ eq "###\n";
38 my ($option, $value) = split;
39 $options{$option} = $value;
41 open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
43 last if $_ eq "###\n";
47 my $parser = Pod::Text->new (%options) or die "Cannot create parser\n";
48 $parser->parse_from_file ('tmp.pod', 'out.tmp');
50 open (TMP, 'out.tmp') or die "Cannot open out.tmp: $!\n";
57 unlink ('tmp.pod', 'out.tmp');
60 last if $_ eq "###\n";
63 if ($output eq $expected) {
67 print "Expected\n========\n$expected\nOutput\n======\n$output\n";
72 # Below the marker are bits of POD and corresponding expected text output.
73 # This is used to test specific features or problems with Pod::Text. The
74 # input and output are separated by lines containing only ###.
120 This is some body text that is long enough to be a paragraph that wraps,
121 thereby testing margins with wrapped paragraphs.
123 This is some verbatim text.
129 This is a test of an indented paragraph.
131 This is another indented paragraph.
136 This is some body text that is long enough to be a paragraph that
137 wraps, thereby testing margins with wrapped paragraphs.
139 This is some verbatim text.
141 Test This is a test of an indented paragraph.
143 This is another indented paragraph.
150 This is some random text.
151 This is more random text.
153 This is some random text.
154 This is more random text.
162 This is more random text.
164 This is some random text.
165 This is more random text.
167 This is some random text.
168 This is more random text.
174 This is more random text.
182 Whitespace around C<< this. >> must be ignored per perlpodspec. >>
183 needs to eat all of the space in front of it.
188 Whitespace around "this." must be ignored per perlpodspec. >> needs to
189 eat all of the space in front of it.