From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E45B51F6FE for ; Sat, 11 Apr 2020 10:53:30 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/4] t/*.t: localize $SIG{__WARN__} changes Date: Sat, 11 Apr 2020 10:53:29 +0000 Message-Id: <20200411105330.19544-4-e@yhbt.net> In-Reply-To: <20200411105330.19544-1-e@yhbt.net> References: <20200411105330.19544-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We don't want to propagate %SIG changes to other tests when running multiple tests within the same process via t/run.perl. --- t/mda_filter_rubylang.t | 2 +- t/nntpd.t | 2 +- t/watch_filter_rubylang.t | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/t/mda_filter_rubylang.t b/t/mda_filter_rubylang.t index dbcb275b..6f288b7e 100644 --- a/t/mda_filter_rubylang.t +++ b/t/mda_filter_rubylang.t @@ -18,7 +18,7 @@ is(system(@cfg, 'publicinboxmda.spamcheck', 'none'), 0); for my $v (qw(V1 V2)) { my @warn; - $SIG{__WARN__} = sub { push @warn, @_ }; + local $SIG{__WARN__} = sub { push @warn, @_ }; my $cfgpfx = "publicinbox.$v"; my $inboxdir = "$tmpdir/$v"; my $addr = "test-$v\@example.com"; diff --git a/t/nntpd.t b/t/nntpd.t index 43b14d66..826e3f3d 100644 --- a/t/nntpd.t +++ b/t/nntpd.t @@ -268,7 +268,7 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000 $for_leafnode->header_set('Message-ID', @mids); $for_leafnode->body_set('not-a-dupe'); my $warn = ''; - $SIG{__WARN__} = sub { $warn .= join('', @_) }; + local $SIG{__WARN__} = sub { $warn .= join('', @_) }; $im->add($for_leafnode); $im->done; like($warn, qr/reused/, 'warned for reused MID'); diff --git a/t/watch_filter_rubylang.t b/t/watch_filter_rubylang.t index b4540660..09217d94 100644 --- a/t/watch_filter_rubylang.t +++ b/t/watch_filter_rubylang.t @@ -24,7 +24,7 @@ SKIP: { for my $v (@v) { my @warn; - $SIG{__WARN__} = sub { push @warn, @_ }; + local $SIG{__WARN__} = sub { push @warn, @_ }; my $cfgpfx = "publicinbox.$v"; my $inboxdir = "$tmpdir/$v"; my $maildir = "$tmpdir/md-$v";