public-inbox.git  about / heads / tags
an "archives first" approach to mailing lists
blob 8563e32039dcc0699228f2da0dfec8097b9ecb90 584 bytes (raw)
$ git show ci-WIP:t/inbox.t	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 
# Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
use warnings;
use Test::More;
use_ok 'PublicInbox::Inbox';
my $x = PublicInbox::Inbox->new({url => '//example.com/test/'});
is($x->base_url, 'https://example.com/test/', 'expanded protocol-relative');
$x = PublicInbox::Inbox->new({url => 'http://example.com/test'});
is($x->base_url, 'http://example.com/test/', 'added trailing slash');

$x = PublicInbox::Inbox->new({});
is($x->base_url, undef, 'undef base_url allowed');

done_testing();

git clone https://public-inbox.org/public-inbox.git
git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/public-inbox.git