1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/usr/bin/perl -w
# t/fcodes.t - check formatting codes
BEGIN {
chdir 't' if -d 't';
}
use strict;
use lib '../lib';
use Test::More tests => 4;
use_ok('Pod::PseudoPod::HTML') or exit;
my $parser = Pod::PseudoPod::HTML->new ();
isa_ok ($parser, 'Pod::PseudoPod::HTML');
my $results;
initialize($parser, $results);
$parser->parse_string_document(<<'EOPOD');
=pod
B<Egad!> You astound me, Brain!
EOPOD
is($results, <<'EOHTML', "simple B<> code");
<p><strong>Egad!</strong> You astound me, Brain!</p>
EOHTML
initialize($parser, $results);
$parser->parse_string_document(<<'EOPOD');
=pod
literal code with B<bold> characters
and some more lines, to test.
EOPOD
is($results, <<'EOHTML', "B<> in literal code");
<pre><code> literal code with <strong>bold</strong> characters
and some more lines, to test.</code></pre>
EOHTML
######################################
sub initialize {
$_[0] = Pod::PseudoPod::HTML->new ();
$_[0]->output_string( \$results ); # Send the resulting output to a string
$_[1] = '';
return;
}
|