# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' use strict; use Test; BEGIN { plan tests => 3 } use HTML::Subtext; ok(1); my $INPUT = <example Author's name here mailto: link here EOT my %context = ( 'author/name' => 'Kaelin Colclasure', 'author/email' => 'kaelin@acm.org' ); my $EXPECTED = <example Kaelin Colclasure kaelin\@acm.org EOT my $p; my @OUTPUT_ARRAY; $p = HTML::Subtext->new('CONTEXT' => \%context, 'OUTPUT' => \@OUTPUT_ARRAY); $p->parse($INPUT); ok(join("", @OUTPUT_ARRAY) . "\n", $EXPECTED); my $OUTPUT_SCALAR = ""; $p = HTML::Subtext->new('CONTEXT' => \%context, 'OUTPUT' => \$OUTPUT_SCALAR); $p->parse($INPUT); ok($OUTPUT_SCALAR . "\n", $EXPECTED);