xref: /openbsd-src/gnu/usr.bin/perl/cpan/Pod-Simple/t/html03.t (revision 5486feefcc8cb79b19e014ab332cc5dfd05b3b33)
1b39c5158Smillert# Testing HTML titles
2b39c5158Smillertuse strict;
3256a93a4Safresh1use warnings;
4*5486feefSafresh1use Test::More tests => 5;
5b39c5158Smillert
6b39c5158Smillert#use Pod::Simple::Debug (10);
7b39c5158Smillert
8b39c5158Smillertuse Pod::Simple::HTML;
9b39c5158Smillert
10256a93a4Safresh1sub x { Pod::Simple::HTML->_out(
11b39c5158Smillert  #sub{  $_[0]->bare_output(1)  },
12b39c5158Smillert  "=pod\n\n$_[0]",
13b39c5158Smillert) }
14b39c5158Smillert
15b39c5158Smillert# make sure empty file => empty output
16b39c5158Smillert
17*5486feefSafresh1is( x(''),'', "Contentlessness" );
18*5486feefSafresh1like( x(qq{=pod\n\nThis is a paragraph}), qr{<title></title>}i );
19*5486feefSafresh1like( x(qq{This is a paragraph}), qr{<title></title>}i );
20*5486feefSafresh1like( x(qq{=head1 Prok\n\nThis is a paragraph}), qr{<title>Prok</title>}i );
21*5486feefSafresh1like( x(qq{=head1 NAME\n\nProk -- stuff\n\nThis}), qr{<title>Prok</title>} );
22