]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/psgi_v2.t
update copyrights for 2021
[public-inbox.git] / t / psgi_v2.t
index c13f5e71b18419300594c481720a2381b3d0dbf3..7ab60adcc46f00f33cec66b2b64ccbeb4903204a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2018-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2018-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
@@ -87,12 +87,11 @@ like($$msg, qr/\AFrom oldbug/s,
        '"From_" line stored to test old bug workaround');
 
 my $cfgpfx = "publicinbox.v2test";
-my $cfg = <<EOF;
+my $cfg = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$ibx->{-primary_address}
 $cfgpfx.inboxdir=$inboxdir
 EOF
-my $config = PublicInbox::Config->new(\$cfg);
-my $www = PublicInbox::WWW->new($config);
+my $www = PublicInbox::WWW->new($cfg);
 my ($res, $raw, @from_);
 my $client0 = sub {
        my ($cb) = @_;
@@ -154,7 +153,7 @@ my $client1 = sub {
        like($raw, qr/^hello ghosts$/m, 'got third message');
        @from_ = ($raw =~ m/^From /mg);
        is(scalar(@from_), 3, 'three From_ lines');
-       $config->each_inbox(sub { $_[0]->search->reopen });
+       $cfg->each_inbox(sub { $_[0]->search->reopen });
 
        SKIP: {
                eval { require IO::Uncompress::Gunzip };
@@ -244,7 +243,7 @@ $run_httpd->($client1, 38);
        $im->done;
        my @h = $mime->header('Message-ID');
        is_deeply($exp, \@h, 'reused existing Message-ID');
-       $config->each_inbox(sub { $_[0]->search->reopen });
+       $cfg->each_inbox(sub { $_[0]->search->reopen });
 }
 
 my $client2 = sub {
@@ -283,7 +282,7 @@ $run_httpd->($client2, 8);
                ok($im->add($mime), "added attachment $body");
        }
        $im->done;
-       $config->each_inbox(sub { $_[0]->search->reopen });
+       $cfg->each_inbox(sub { $_[0]->search->reopen });
 }
 
 my $client3 = sub {