use strict; use warnings; use Test::More tests => 7; BEGIN { use_ok( 'HTML::LinkAdd' ); } BASIC: { my $o = HTML::LinkAdd->new( \'This is some text to hyperlink ...', { hyperlink => 'http://www.google.co.uk', } ); isa_ok( $o, 'HTML::LinkAdd'); is( $o->hyperlinked, $o->{output}, 'getter' ); is( $o->hyperlinked, 'This is some text to hyperlink ...', 'hyperlinked word, old' ); } ARRAYS: { my $o = HTML::LinkAdd->new( \'This is some text to hyperlink ...', { hyperlink => ['http://www.google.co.uk','The Title'], } ); is( $o->hyperlinked, 'This is some text to hyperlink ...', 'hyperlinked word new' ); } SKIPTO:{ my $o = HTML::LinkAdd->new( \'
no hyperlinkThis is some text to hyperlink ...no hyperlink
no hyperlink
'; my $o = HTML::LinkAdd->new( \$txt, { hyperlink => ['http://www.google.co.uk','The Title'], } ); is( $o->hyperlinked, $txt, 'skip head/pre' ); }no hyperlink