2 # $Id: pod-parser.t,v 1.2 2006-09-16 21:09:57 eagle Exp $
4 # pod-parser.t -- Tests for backward compatibility with Pod::Parser.
6 # Copyright 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;
33 my $parser = Pod::Man->new or die "Cannot create parser\n";
34 open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
35 print TMP "Some random B<text>.\n";
37 open (OUT, '> out.tmp') or die "Cannot create out.tmp: $!\n";
38 $parser->parse_from_file ({ -cutting => 0 }, 'tmp.pod', \*OUT);
40 open (OUT, 'out.tmp') or die "Cannot open out.tmp: $!\n";
41 while (<OUT>) { last if /^\.nh/ }
48 if ($output eq "Some random \\fBtext\\fR.\n") {
52 print "Expected\n========\nSome random \\fBtext\\fR.\n\n";
53 print "Output\n======\n$output\n";
56 $parser = Pod::Text->new or die "Cannot create parser\n";
57 open (OUT, '> out.tmp') or die "Cannot create out.tmp: $!\n";
58 $parser->parse_from_file ({ -cutting => 0 }, 'tmp.pod', \*OUT);
60 open (OUT, 'out.tmp') or die "Cannot open out.tmp: $!\n";
66 if ($output eq " Some random text.\n\n") {
70 print "Expected\n========\n Some random text.\n\n\n";
71 print "Output\n======\n$output\n";
74 unlink ('tmp.pod', 'out.tmp');