about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-13 20:27:04 +0000
committerEric Wong <e@yhbt.net>2020-06-15 08:39:43 +0000
commitbd55dffe2deafedeb9ac5f750dda46e3a2247018 (patch)
treeca0313311ab5302ee2d6de1d83664220064d6145 /t
parent16d4a34a7e796630d92949c4193db4b77bd7dd9d (diff)
downloadpublic-inbox-bd55dffe2deafedeb9ac5f750dda46e3a2247018.tar.gz
Mail::IMAPClient understandably stumbles into a warning
by our bogus test request.  Just silence it on our end
since it's not normal operation for Mail::IMAPClient.
Diffstat (limited to 't')
-rw-r--r--t/imapd.t10
1 files changed, 8 insertions, 2 deletions
diff --git a/t/imapd.t b/t/imapd.t
index aba3ed82..edfc5204 100644
--- a/t/imapd.t
+++ b/t/imapd.t
@@ -148,10 +148,16 @@ is_deeply(scalar $mic->flags('1'), [], '->flags works');
         my $exp = $mic->fetch_hash(1, 'UID');
         $ret = $mic->fetch_hash('559:*', 'UID');
         is_deeply($ret, $exp, 'beginning range too big');
-        for my $r (qw(559:558 558:559)) {
-                $ret = $mic->fetch_hash($r, 'UID');
+        {
+                my @w; # Mail::IMAPClient hits a warning via overload
+                local $SIG{__WARN__} = sub { push @w, @_ };
+                $ret = $mic->fetch_hash(my $r = '559:558', 'UID');
                 is_deeply($ret, {}, "out-of-range UID FETCH $r");
+                @w = grep(!/\boverload\.pm\b/, @w);
+                is_deeply(\@w, [], 'no unexpected warning');
         }
+        $ret = $mic->fetch_hash(my $r = '558:559', 'UID');
+        is_deeply($ret, {}, "out-of-range UID FETCH $r");
 }
 
 for my $r ('1:*', '1') {