]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/linkify.t
TODO: support migration to v2 without breaking v1 "git fetch"
[public-inbox.git] / t / linkify.t
index 041c15c73144efcd8c966ce08f71f7ed10c9e94f..f0b3a6d0b34bdb438a0fc940a9bbb3da2bbce87b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
@@ -14,6 +14,15 @@ use PublicInbox::Linkify;
        is($s, qq(<a\nhref="$u">$u</a>.), 'trailing period not in URL');
 }
 
+{
+       my $l = PublicInbox::Linkify->new;
+       my $u = 'http://i-forgot-trailing-slash.example.com';
+       my $s = $u;
+       $s = $l->linkify_1($s);
+       $s = $l->linkify_2($s);
+       is($s, qq(<a\nhref="$u">$u</a>), 'missing trailing slash OK');
+}
+
 # handle URLs in parenthesized statements
 {
        my $l = PublicInbox::Linkify->new;