]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/msg_iter.t
msg_iter: pass $idx as a scalar, not array
[public-inbox.git] / t / msg_iter.t
index 6adbf165b0713268cfb87bf73c9b7b9d7c45d1a9..e8115e2584c7ba7a0ccf58fab7511a123e490eb0 100644 (file)
@@ -5,7 +5,6 @@ use warnings;
 use Test::More;
 use PublicInbox::TestCommon;
 use PublicInbox::Hval qw(ascii_html);
-use PublicInbox::InboxWritable;
 use_ok('PublicInbox::MsgIter');
 
 {
@@ -29,14 +28,12 @@ use_ok('PublicInbox::MsgIter');
                $s =~ s/\s+//s;
                push @parts, [ $s, $level, @ex ];
        });
-       is_deeply(\@parts, [ [qw(a 2 1 1)], [qw(b 2 1 2)], [qw(sig 1 2)] ],
+       is_deeply(\@parts, [ [qw(a 2 1.1)], [qw(b 2 1.2)], [qw(sig 1 2)] ],
                'nested part shows up properly');
 }
 
 {
-       my $f = 't/iso-2202-jp.eml';
-       my $mime = PublicInbox::InboxWritable::mime_from_path($f) or
-               die "open $f: $!";
+       my $mime = mime_load 't/iso-2202-jp.eml';
        my $raw = '';
        msg_iter($mime, sub {
                my ($part, $level, @ex) = @{$_[0]};
@@ -49,9 +46,7 @@ use_ok('PublicInbox::MsgIter');
 }
 
 {
-       my $f = 't/x-unknown-alpine.eml';
-       my $mime = PublicInbox::InboxWritable::mime_from_path($f) or
-               die "open $f: $!";
+       my $mime = mime_load 't/x-unknown-alpine.eml';
        my $raw = '';
        msg_iter($mime, sub {
                my ($part, $level, @ex) = @{$_[0]};