]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/linkify.t
linkify: handle URLs in parenthesized statements
[public-inbox.git] / t / linkify.t
index 99acf17d593830884b1533452bf2ceae9ef8cd28..041c15c73144efcd8c966ce08f71f7ed10c9e94f 100644 (file)
@@ -14,6 +14,16 @@ use PublicInbox::Linkify;
        is($s, qq(<a\nhref="$u">$u</a>.), 'trailing period not in URL');
 }
 
+# handle URLs in parenthesized statements
+{
+       my $l = PublicInbox::Linkify->new;
+       my $u = 'http://example.com/';
+       my $s = "(see: $u)";
+       $s = $l->linkify_1($s);
+       $s = $l->linkify_2($s);
+       is($s, qq{(see: <a\nhref="$u">$u</a>)}, 'trailing ) not in URL');
+}
+
 {
        my $l = PublicInbox::Linkify->new;
        my $u = 'http://example.com/url-with-trailing-semicolon';