5 my $cls = 'PublicInbox::LeiExternal';
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');