$$sql .= ' AND num < 0';
}
-# XXX not sure suppessing RD_* is needed here, but t/imap_searchqp.t
-# sporadically fails
-local ($::RD_ERRORS, $::RD_WARN);
my $prd = Parse::RecDescent->new(<<'EOG');
<nocheck>
{ my $q = $PublicInbox::IMAPsearchqp::q; }
my ($imap, $query) = @_;
my $sql = '';
%$q = (sql => \$sql, imap => $imap); # imap = PublicInbox::IMAP obj
- # XXX not always effective for t/imap_searchqp.t
- local ($::RD_ERRORS, $::RD_WARN);
+ # Inline::C::Parser::RecDescent may set RD_HINT
+ local ($::RD_ERRORS, $::RD_WARN, $::RD_HINT);
my $res = eval { $prd->search_key(uc($query)) };
return $@ if $@ && $@ =~ /\A(?:BAD|NO) /;
return 'BAD unexpected result' if !$res || $res != $q;
open STDERR, '>&', $olderr;
seek $tmperr, 0, SEEK_SET;
read($tmperr, my $buf, -s $tmperr);
- is($buf, '', 'nothing spewed to STDERR on bad query') or warn <<'EOM';
-FIXME: this sometimes fails despite setting $::RD_ERRORS + $::RD_WARN to
-undef in PublicInbox::IMAPsearchqp::parse and I don't understand why.
-It usually suceeds. Let us know if you can help us understand this
-occasional failure at meta@public-inbox.org
-EOM
+ is $buf, '', 'nothing spewed to STDERR on bad query';
}
like($q, qr/\ABAD /, 'bad charset rejected');