]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/www_listing.t
tests: favor IPv6
[public-inbox.git] / t / www_listing.t
index 636133715eb1f4cbe5c93ac56197c9d29430727e..63ef2eacfd407d510088a6532bc72b34177d5533 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 # manifest.js.gz generation and grok-pull integration test
 use strict;
@@ -7,14 +7,12 @@ use Test::More;
 use PublicInbox::Spawn qw(which);
 use PublicInbox::TestCommon;
 use PublicInbox::Import;
-require_mods(qw(URI::Escape Plack::Builder Digest::SHA
+require_mods(qw(json URI::Escape Plack::Builder Digest::SHA
                IO::Compress::Gzip IO::Uncompress::Gunzip HTTP::Tiny));
 require PublicInbox::WwwListing;
 require PublicInbox::ManifestJsGz;
-my $json = do {
-       no warnings 'once';
-       $PublicInbox::ManifestJsGz::json;
-} or plan skip_all => "JSON module missing";
+use PublicInbox::Config;
+my $json = PublicInbox::Config::json();
 
 use_ok 'PublicInbox::Git';
 
@@ -81,8 +79,7 @@ SKIP: {
        my $cfgfile = "$tmpdir/config";
        my $v2 = "$tmpdir/v2";
        my $sock = tcp_server();
-       ok($sock, 'sock created');
-       my ($host, $port) = ($sock->sockhost, $sock->sockport);
+       my ($host, $port) = tcp_host_port($sock);
        my @clone = qw(git clone -q -s --bare);
        is(xsys(@clone, $bare->{git_dir}, $alt), 0, 'clone shared repo');