]> Sergey Matveev's repositories - public-inbox.git/blob - t/lei_external.t
doc: re-add missing 1.6 release notes
[public-inbox.git] / t / lei_external.t
1 #!perl -w
2 use strict;
3 use v5.10.1;
4 use Test::More;
5 my $cls = 'PublicInbox::LeiExternal';
6 require_ok $cls;
7 my $canon = $cls->can('_canonicalize');
8 my $exp = 'https://example.com/my-inbox/';
9 is($canon->('https://example.com/my-inbox'), $exp, 'trailing slash added');
10 is($canon->('https://example.com/my-inbox//'), $exp, 'trailing slash removed');
11 is($canon->('https://example.com//my-inbox/'), $exp, 'leading slash removed');
12 is($canon->('https://EXAMPLE.com/my-inbox/'), $exp, 'lowercased');
13 is($canon->('/this/path/is/nonexistent/'), '/this/path/is/nonexistent',
14         'non-existent pathname canonicalized');
15 is($canon->('/this//path/'), '/this/path', 'extra slashes gone');
16 is($canon->('/ALL/CAPS'), '/ALL/CAPS', 'caps preserved');
17
18 done_testing;