+{
+ my $html = <<EOM;
+<html><head><title>hi,</title></head><body>how are you</body></html>
+EOM
+ for my $m (qw(mboxrd mboxcl mboxcl2 mboxo)) {
+ my (@w, @x);
+ local $SIG{__WARN__} = sub { push @w, @_ };
+ open my $fh, '<', \$html or xbail 'PerlIO::scalar';
+ PublicInbox::MboxReader->$m($fh, sub {
+ push @x, $_[0]->as_string
+ });
+ if ($m =~ /\Amboxcl/) {
+ is_deeply(\@x, [], "messages in invalid $m");
+ } else {
+ is_deeply(\@x, [ "\n$html" ], "body-only $m");
+ }
+ is_deeply([grep(!/^W: leftover/, @w)], [],
+ "no extra warnings besides leftover ($m)");
+ }
+}
+