about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-11-24 00:22:22 +0000
committerEric Wong <e@80x24.org>2019-11-24 21:33:28 +0000
commit6b071c721412bc1c8e3fae7d85b22bd5f87ca9fb (patch)
treec1463dc1590059805768d5b59d35b06ec5cd5756
parent9bd294a216c0cd2fd013afd6ff047848d35d76aa (diff)
downloadpublic-inbox-6b071c721412bc1c8e3fae7d85b22bd5f87ca9fb.tar.gz
The "strict" pragma makes code easier to debug, and we had
undeclared variables as a result in t/watch_maildir_v2.t.
So use it everywhere to be consistent with the rest of our
code.
-rw-r--r--t/mid.t1
-rw-r--r--t/qspawn.t1
-rw-r--r--t/watch_maildir.t1
-rw-r--r--t/watch_maildir_v2.t7
4 files changed, 7 insertions, 3 deletions
diff --git a/t/mid.t b/t/mid.t
index 98b0c200..ecac04de 100644
--- a/t/mid.t
+++ b/t/mid.t
@@ -1,5 +1,6 @@
 # Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+use strict;
 use Test::More;
 use PublicInbox::MID qw(mid_escape mids references mids_for_index);
 
diff --git a/t/qspawn.t b/t/qspawn.t
index 58c6febb..fc288a2d 100644
--- a/t/qspawn.t
+++ b/t/qspawn.t
@@ -1,5 +1,6 @@
 # Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+use strict;
 use Test::More;
 use_ok 'PublicInbox::Qspawn';
 
diff --git a/t/watch_maildir.t b/t/watch_maildir.t
index e6cd599c..41d50329 100644
--- a/t/watch_maildir.t
+++ b/t/watch_maildir.t
@@ -1,5 +1,6 @@
 # Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+use strict;
 use Test::More;
 use File::Temp qw/tempdir/;
 use Email::MIME;
diff --git a/t/watch_maildir_v2.t b/t/watch_maildir_v2.t
index 7fe23521..e0e8a13f 100644
--- a/t/watch_maildir_v2.t
+++ b/t/watch_maildir_v2.t
@@ -1,5 +1,6 @@
 # Copyright (C) 2018-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+use strict;
 use Test::More;
 use File::Temp qw/tempdir/;
 use PublicInbox::MIME;
@@ -106,7 +107,7 @@ More majordomo info at  http://vger.kernel.org/majordomo-info.html\n);
                 local $SIG{__WARN__} = sub {}; # quiet spam check warning
                 PublicInbox::WatchMaildir->new($config)->scan('full');
         }
-        ($nr, $msgs) = $srch->reopen->query('');
+        my ($nr, $msgs) = $srch->reopen->query('');
         is($nr, 0, 'inbox is still empty');
         is(unlink(glob("$maildir/new/*")), 1);
 }
@@ -119,7 +120,7 @@ More majordomo info at  http://vger.kernel.org/majordomo-info.html\n);
         PublicInbox::Emergency->new($maildir)->prepare(\$msg);
         $config->{'publicinboxwatch.spamcheck'} = 'spamc';
         PublicInbox::WatchMaildir->new($config)->scan('full');
-        ($nr, $msgs) = $srch->reopen->query('');
+        my ($nr, $msgs) = $srch->reopen->query('');
         is($nr, 1, 'inbox has one mail after spamc OK-ed a message');
         my $mref = $ibx->msg_by_smsg($msgs->[0]);
         like($$mref, qr/something\n\z/s, 'message scrubbed on import');
@@ -132,7 +133,7 @@ More majordomo info at  http://vger.kernel.org/majordomo-info.html\n);
         $msg = eval { local $/; <$fh> };
         PublicInbox::Emergency->new($maildir)->prepare(\$msg);
         PublicInbox::WatchMaildir->new($config)->scan('full');
-        ($nr, $msgs) = $srch->reopen->query('dfpost:6e006fd7');
+        my ($nr, $msgs) = $srch->reopen->query('dfpost:6e006fd7');
         is($nr, 1, 'diff postimage found');
         my $post = $msgs->[0];
         ($nr, $msgs) = $srch->query('dfpre:090d998b6c2c');