2 # $Id: text-options.t,v 1.6 2006-01-28 22:31:50 eagle Exp $
4 # text-options.t -- Additional tests for Pod::Text options.
6 # Copyright 2002, 2004, 2006 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 open (OUT, '> out.tmp') or die "Cannot create out.tmp: $!\n";
49 $parser->parse_from_file ('tmp.pod', \*OUT);
51 open (TMP, 'out.tmp') or die "Cannot open out.tmp: $!\n";
58 unlink ('tmp.pod', 'out.tmp');
61 last if $_ eq "###\n";
64 if ($output eq $expected) {
68 print "Expected\n========\n$expected\nOutput\n======\n$output\n";
73 # Below the marker are bits of POD and corresponding expected text output.
74 # This is used to test specific features or problems with Pod::Text. The
75 # input and output are separated by lines containing only ###.
121 This is some body text that is long enough to be a paragraph that wraps,
122 thereby testing margins with wrapped paragraphs.
124 This is some verbatim text.
130 This is a test of an indented paragraph.
132 This is another indented paragraph.
137 This is some body text that is long enough to be a paragraph that
138 wraps, thereby testing margins with wrapped paragraphs.
140 This is some verbatim text.
142 Test This is a test of an indented paragraph.
144 This is another indented paragraph.
151 This is some random text.
152 This is more random text.
154 This is some random text.
155 This is more random text.
163 This is more random text.
165 This is some random text.
166 This is more random text.
168 This is some random text.
169 This is more random text.
175 This is more random text.
183 Whitespace around C<< this. >> must be ignored per perlpodspec. >>
184 needs to eat all of the space in front of it.
189 Whitespace around "this." must be ignored per perlpodspec. >> needs to
190 eat all of the space in front of it.