3 # pod-parser.t -- Tests for backward compatibility with Pod::Parser.
5 # Copyright 2006 by 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');
17 unshift (@INC, '../blib/lib');
23 print "not ok 1\n" unless $loaded;
32 my $parser = Pod::Man->new or die "Cannot create parser\n";
33 open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
34 print TMP "Some random B<text>.\n";
36 open (OUT, '> out.tmp') or die "Cannot create out.tmp: $!\n";
37 $parser->parse_from_file ({ -cutting => 0 }, 'tmp.pod', \*OUT);
39 open (OUT, 'out.tmp') or die "Cannot open out.tmp: $!\n";
40 while (<OUT>) { last if /^\.nh/ }
47 if ($output eq "Some random \\fBtext\\fR.\n") {
51 print "Expected\n========\nSome random \\fBtext\\fR.\n\n";
52 print "Output\n======\n$output\n";
55 $parser = Pod::Text->new or die "Cannot create parser\n";
56 open (OUT, '> out.tmp') or die "Cannot create out.tmp: $!\n";
57 $parser->parse_from_file ({ -cutting => 0 }, 'tmp.pod', \*OUT);
59 open (OUT, 'out.tmp') or die "Cannot open out.tmp: $!\n";
65 if ($output eq " Some random text.\n\n") {
69 print "Expected\n========\n Some random text.\n\n\n";
70 print "Output\n======\n$output\n";
73 unlink ('tmp.pod', 'out.tmp');