-# Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2020 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
use warnings;
use Test::More;
use Email::MIME;
+use PublicInbox::Hval qw(ascii_html);
use_ok('PublicInbox::MsgIter');
{
is(index($raw, '$$$'), -1, 'no unescaped $$$');
}
+{
+ my $f = 't/x-unknown-alpine.eml';
+ my $mime = Email::MIME->new(do {
+ open my $fh, '<', $f or die "open($f): $!";
+ local $/;
+ binmode $fh;
+ <$fh>;
+ });
+ my $raw = '';
+ msg_iter($mime, sub {
+ my ($part, $level, @ex) = @{$_[0]};
+ my ($s, $err) = msg_part_text($part, 'text/plain');
+ $raw .= $s;
+ });
+ like($raw, qr!^\thttps://!ms, 'tab expanded with X-UNKNOWN');
+ like(ascii_html($raw), qr/• bullet point/s,
+ 'got bullet point when X-UNKNOWN assumes UTF-8');
+}
+
done_testing();
1;