2 # $Id: text-options.t,v 1.5 2006-01-20 21:20:58 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');
49 open (TMP, 'out.tmp') or die "Cannot open out.tmp: $!\n";
56 unlink ('tmp.pod', 'out.tmp');
59 last if $_ eq "###\n";
62 if ($output eq $expected) {
66 print "Expected\n========\n$expected\nOutput\n======\n$output\n";
71 # Below the marker are bits of POD and corresponding expected text output.
72 # This is used to test specific features or problems with Pod::Text. The
73 # input and output are separated by lines containing only ###.
119 This is some body text that is long enough to be a paragraph that wraps,
120 thereby testing margins with wrapped paragraphs.
122 This is some verbatim text.
128 This is a test of an indented paragraph.
130 This is another indented paragraph.
135 This is some body text that is long enough to be a paragraph that
136 wraps, thereby testing margins with wrapped paragraphs.
138 This is some verbatim text.
140 Test This is a test of an indented paragraph.
142 This is another indented paragraph.
149 This is some random text.
150 This is more random text.
152 This is some random text.
153 This is more random text.
161 This is more random text.
163 This is some random text.
164 This is more random text.
166 This is some random text.
167 This is more random text.
173 This is more random text.
181 Whitespace around C<< this. >> must be ignored per perlpodspec. >>
182 needs to eat all of the space in front of it.
187 Whitespace around "this." must be ignored per perlpodspec. >> needs to
188 eat all of the space in front of it.