diff options
Diffstat (limited to 't/imap_searchqp.t')
-rw-r--r-- | t/imap_searchqp.t | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/t/imap_searchqp.t b/t/imap_searchqp.t index e2f49e5a..ff1b4535 100644 --- a/t/imap_searchqp.t +++ b/t/imap_searchqp.t @@ -1,5 +1,5 @@ #!perl -w -# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> use strict; use v5.10.1; @@ -28,12 +28,15 @@ $q = $parse->(qq{CHARSET UTF-8 From b}); is($q->{xap}, 'f:"b"', 'charset handled'); $q = $parse->(qq{CHARSET WTF-8 From b}); like($q, qr/\ANO \[/, 'bad charset rejected'); -{ - # TODO: squelch errors by default? clients could flood logs - open my $fh, '>:scalar', \(my $buf) or die; + +for my $x ('', ' (try #2)') { + open my $fh, '>:scalar', \(my $buf = '') or die; local *STDERR = $fh; $q = $parse->(qq{CHARSET}); + last if is($buf, '', "nothing spewed to STDERR on bad query$x"); + diag 'FIXME: above fails mysteriously sometimes, so we try again...'; } + like($q, qr/\ABAD /, 'bad charset rejected'); $q = $parse->(qq{HEADER CC B (SENTBEFORE 2-Oct-1993)}); |