about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-02-01 05:27:52 +0000
committerEric Wong <e@80x24.org>2019-02-01 05:27:52 +0000
commit58700fb1830d1f854e688dfa47390d7f2eef9035 (patch)
tree9d6b814d257bf2381198a0b276f06aa055ad9f4a /t
parent7475739ec4e426004619f95f6e48fa07d940a5c0 (diff)
downloadpublic-inbox-58700fb1830d1f854e688dfa47390d7f2eef9035.tar.gz
Sometimes users will write "http://example.com" without the
trailing slash, which every browser and tool I've tested seems
to understand.
Diffstat (limited to 't')
-rw-r--r--t/linkify.t9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/linkify.t b/t/linkify.t
index a55ed22a..f0b3a6d0 100644
--- a/t/linkify.t
+++ b/t/linkify.t
@@ -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;