#!/usr/bin/perl -w #$Id: 01defaults.t,v 1.17 2005/07/15 10:28:37 simonf Exp $ use strict; use lib qw(./lib ../lib); use Test; use Pod::Xhtml; use Getopt::Std; getopts('tTs', \my %opt); if ($opt{t} || $opt{T}) { require Log::Trace; import Log::Trace print => {Deep => $opt{T}}; } if (-d 't') { chdir( 't' ); } require Test_LinkParser; my $filecont; my $podia = 'a.pod'; my $podoa = 'a.xhtml'; unlink $podoa if -e $podoa; plan tests => 13; ok( $Pod::Xhtml::VERSION ); my $pod_links = Test_LinkParser->new(); my $parser = Pod::Xhtml->new(LinkParser => $pod_links); #### try parsing from file ok( ! -f $podoa ); $parser->parse_from_file( $podia, $podoa ); ok( -f $podoa ); $filecont = readfile( $podoa ); ok( $filecont ); ok( index( $filecont, cont_a() ) > -1 ); undef $filecont; unlink $podoa; #### parsing from filehandles ok( ! -f $podoa ); open(OUT, '>'.$podoa) or die("Can't open out $podoa: $!"); $parser->parse_from_filehandle( \*DATA, \*OUT ); close OUT; ok( -f $podoa ); $filecont = readfile( $podoa ); ok( $filecont ); ok( index( $filecont, cont_a() ) > -1 ); undef $filecont; unlink $podoa unless $opt{'s'}; my $podib = 'b.pod'; my $podob = 'b.xhtml'; ok ( !-f $podob ); $parser->parse_from_file( $podib, $podob ); ok ( -f $podob ); $filecont = readfile( $podob ); ok( $filecont ); ok( index( $filecont, cont_b() ) > -1 ); undef $filecont; unlink $podob unless $opt{'s'}; sub cont_a { return q{
A - Some demo POD
use Pod::Xhtml; my $px = new Pod::Xhtml;
This is a module to translate POD to Xhtml. Lorem ipsum Dolor in Dolor sit amet consectueur adipscing elit. Sed diam nomumny.
This is a module to translate POD to Xhtml. The Lorem entry ipsum dolor sit amet
consectueur adipscing elit. Sed diam nomumny.
This is a module to translate POD to Xhtml. Lorem ipsum dolor sit amet
consectueur adipscing elit. Sed diam nomumny.
This is a module to translate POD to Xhtml. See Lorem ipsum dolor sit amet
consectueur adipscing elit. Sed diam nomumny. http://foo.bar/baz/
This is verbatim text in a bulleted list
This is verbatim test in a regular list
There are some issues known about. Lorem ipsum dolor sit amet consectueur adipscing elit. Sed diam nomumny. Lorem ipsum dolor sit amet consectueur adipscing elit. Sed diam nomumny. SPACES ARE IMPORTANT
There are also some issues not known about. Lorem ipsum dolor sit amet consectueur adipscing elit. Sed diam nomumny. Lorem ipsum dolor sit amet consectueur adipscing elit. Sed diam nomumny.
B - Some demo POD
use Pod::Xhtml; my $px = new Pod::Xhtml;
To test returning back to head1.
This is a module to translate POD to Xhtml. Lorem ipsum Dolor in Dolor sit amet consectueur adipscing elit. Sed diam nomumny.
@ARGV should link to the as-yet undefined "@ARGV" section
Whereas $ARGV shouldn't. It should link to the undefined "$ARGV" section
Is sometimes undefined
Is occasionally populated with the numbers 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10
Does not exist
<meta />
R&R
"hello"