3 # text.t -- Additional specialized tests for Pod::Text.
5 # Copyright 2002, 2004, 2006, 2007, 2008, 2009 Russ Allbery <rra@stanford.edu>
7 # This program is free software; you may redistribute it and/or modify it
8 # under the same terms as Perl itself.
12 if ($ENV{PERL_CORE}) {
15 unshift (@INC, '../blib/lib');
22 use Test::More tests => 8;
23 BEGIN { use_ok ('Pod::Text') }
25 my $parser = Pod::Text->new;
26 isa_ok ($parser, 'Pod::Text', 'Parser object');
29 next until $_ eq "###\n";
30 open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
32 last if $_ eq "###\n";
36 open (OUT, '> out.tmp') or die "Cannot create out.tmp: $!\n";
37 $parser->parse_from_file ('tmp.pod', \*OUT);
39 open (TMP, 'out.tmp') or die "Cannot open out.tmp: $!\n";
46 1 while unlink ('tmp.pod', 'out.tmp');
49 last if $_ eq "###\n";
52 is ($output, $expected, "Output correct for test $n");
56 # Below the marker are bits of POD and corresponding expected text output.
57 # This is used to test specific features or problems with Pod::Text. The
58 # input and output are separated by lines containing only ###.
65 This C<.> should be quoted.
68 This "." should be quoted.
73 =head1 CE<lt>E<gt> WITH SPACES
75 What does C<< this. >> end up looking like?
78 What does "this." end up looking like?
83 =head1 Test of SE<lt>E<gt>
85 This is some S< > whitespace.
88 This is some whitespace.
103 =for TEXT As should this.
139 This is a L<link|http://www.example.com/> to a URL.
142 This is a link <http://www.example.com/> to a URL.