1# Testing HTML titles 2 3BEGIN { 4 if($ENV{PERL_CORE}) { 5 chdir 't'; 6 @INC = '../lib'; 7 } 8} 9 10use strict; 11use Test; 12BEGIN { plan tests => 7 }; 13 14#use Pod::Simple::Debug (10); 15 16use Pod::Simple::HTML; 17 18sub x ($) { Pod::Simple::HTML->_out( 19 #sub{ $_[0]->bare_output(1) }, 20 "=pod\n\n$_[0]", 21) } 22 23 24# make sure empty file => empty output 25 26ok 1; 27ok( x(''),'', "Contentlessness" ); 28ok( x(qq{=pod\n\nThis is a paragraph}) =~ m{<title></title>}i ); 29ok( x(qq{This is a paragraph}) =~ m{<title></title>}i ); 30ok( x(qq{=head1 Prok\n\nThis is a paragraph}) =~ m{<title>Prok</title>}i ); 31ok( x(qq{=head1 NAME\n\nProk -- stuff\n\nThis}), q{/<title>Prok</title>/} ); 32 33print "# And one for the road...\n"; 34ok 1; 35 36