1 # Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
6 use_ok 'PublicInbox::Inbox';
7 my $x = PublicInbox::Inbox->new({url => [ '//example.com/test/' ]});
8 is($x->base_url, 'https://example.com/test/', 'expanded protocol-relative');
9 $x = PublicInbox::Inbox->new({url => [ 'http://example.com/test' ]});
10 is($x->base_url, 'http://example.com/test/', 'added trailing slash');
12 $x = PublicInbox::Inbox->new({});
13 is($x->base_url, undef, 'undef base_url allowed');