#!perl use strict; use Test::More; BEGIN { use_ok("Text::AutoLink") } subtest "Parsing twitter-style urls should work" => sub { my $auto = Text::AutoLink->new; my $text = $auto->parse_string( "http://www.facebook.com/groups/loctouch/#!/groups/loctouch/236227373098903/" ); my $expected = q|http://www.facebook.com/groups/loctouch/#!/groups/loctouch/236227373098903/|; is $text, $expected; }; subtest "Parsing a linked text should not produce a new link" => sub { my $original = q|http://search.cpan.org|; my $auto = Text::AutoLink->new; my $text = $auto->parse_string($original); is($original, $text); }; subtest "Parsing a text with non-beginning link should linkify" => sub { my $original = <http://search.cpan.org EOS my $auto = Text::AutoLink->new; my $text = $auto->parse_string($original); my $expected = q|http://search.cpan.org|; is($text, $expected); }; done_testing;