about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-05-07 21:05:45 +0000
committerEric Wong <e@yhbt.net>2020-05-09 08:59:10 +0000
commit453dee4881a9c764b09d33f3a827879f2cd3669d (patch)
treee1c5d2fcb1b5e4a7571e9eaf59d6ce6660f3e200 /t
parent8d1b87f498ea47bb752ea24900372df192d322fb (diff)
downloadpublic-inbox-453dee4881a9c764b09d33f3a827879f2cd3669d.tar.gz
This doesn't make any difference for most multipart
messages (or any single part messages).  However,
this starts having space savings when parts start
nesting.

It also slightly simplifies callers.
Diffstat (limited to 't')
-rw-r--r--t/mime.t5
-rw-r--r--t/msg_iter.t2
2 files changed, 4 insertions, 3 deletions
diff --git a/t/mime.t b/t/mime.t
index 0d478ace..b9a4d66b 100644
--- a/t/mime.t
+++ b/t/mime.t
@@ -98,9 +98,10 @@ $msg = PublicInbox::MIME->new($raw);
 my $nr = 0;
 msg_iter($msg, sub {
         my ($part, $level, @ex) = @{$_[0]};
-        if ($ex[0] == 1) {
+        is($level, 1, 'at expected level');
+        if (join('fail if $#ex > 0', @ex) eq '1') {
                 is($part->body_str, "your tree directly? \r\n", 'body OK');
-        } elsif ($ex[0] == 2) {
+        } elsif (join('fail if $#ex > 0', @ex) eq '2') {
                 is($part->body, "-----BEGIN PGP SIGNATURE-----\n\n" .
                                 "=7wIb\n" .
                                 "-----END PGP SIGNATURE-----\n",
diff --git a/t/msg_iter.t b/t/msg_iter.t
index 5c57e043..e8115e25 100644
--- a/t/msg_iter.t
+++ b/t/msg_iter.t
@@ -28,7 +28,7 @@ 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');
 }