lei/store: stop shard workers + cat-file on idle
[public-inbox.git] / t / lei_external.t
blob573cbc601726626dd86dab458de8067729d39d9f
1 #!perl -w
2 # Copyright (C) all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # internal unit test, see t/lei-externals.t for functional tests
5 use v5.12; use Test::More;
6 my $cls = 'PublicInbox::LeiExternal';
7 require_ok $cls;
8 my $canon = $cls->can('ext_canonicalize');
9 my $exp = 'https://example.com/my-inbox/';
10 is($canon->('https://example.com/my-inbox'), $exp, 'trailing slash added');
11 is($canon->('https://example.com/my-inbox//'), $exp, 'trailing slash removed');
12 is($canon->('https://example.com//my-inbox/'), $exp, 'leading slash removed');
13 is($canon->('https://EXAMPLE.com/my-inbox/'), $exp, 'lowercased');
14 is($canon->('/this/path/is/nonexistent/'), '/this/path/is/nonexistent',
15         'non-existent pathname canonicalized');
16 is($canon->('/this//path/'), '/this/path', 'extra slashes gone');
17 is($canon->('/ALL/CAPS'), '/ALL/CAPS', 'caps preserved');
19 done_testing;