]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/mime.t
msg_iter: pass $idx as a scalar, not array
[public-inbox.git] / t / mime.t
index 72140ebf372cf47e1447b0092fe0dcad441c053a..b9a4d66b098cd2fde269576953c629ede97e8777 100644 (file)
--- a/t/mime.t
+++ b/t/mime.t
@@ -1,4 +1,4 @@
-# Copyright (C) 2017-2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2017-2020 all contributors <meta@public-inbox.org>
 # This library is free software; you can redistribute it and/or modify
 # it under the same terms as Perl itself.
 # Artistic or GPL-1+ <https://www.gnu.org/licenses/gpl-1.0.txt>
@@ -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",