2 # Copyright (C) 2017-2020 all contributors <meta@public-inbox.org>
3 # This library is free software; you can redistribute it and/or modify
4 # it under the same terms as Perl itself.
5 # Artistic or GPL-1+ <https://www.gnu.org/licenses/gpl-1.0.txt>
8 use PublicInbox::TestCommon;
9 use PublicInbox::MsgIter;
10 my @classes = qw(PublicInbox::Eml);
12 require_mods('Email::MIME', 1);
13 push @classes, 'PublicInbox::MIME';
15 use_ok $_ for @classes;
16 local $SIG{__WARN__} = sub {}; # needed for old Email::Simple (used by E::M)
18 for my $cls (@classes) {
19 my $msg = $cls->new(<<'EOF');
20 From: Richard Hansen <hansenr@google.com>
21 To: git@vger.kernel.org
22 Cc: Richard Hansen <hansenr@google.com>
23 Subject: [PATCH 0/2] minor diff orderfile documentation improvements
24 Date: Mon, 9 Jan 2017 19:40:29 -0500
25 Message-Id: <20170110004031.57985-1-hansenr@google.com>
26 X-Mailer: git-send-email 2.11.0.390.gc69c2f50cf-goog
27 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256;
28 boundary="94eb2c0bc864b76ba30545b2bca9"
30 --94eb2c0bc864b76ba30545b2bca9
33 diff: document behavior of relative diff.orderFile
34 diff: document the pattern format for diff.orderFile
36 Documentation/diff-config.txt | 5 ++++-
37 Documentation/diff-options.txt | 3 ++-
38 2 files changed, 6 insertions(+), 2 deletions(-)
41 --94eb2c0bc864b76ba30545b2bca9
42 Content-Type: application/pkcs7-signature; name="smime.p7s"
43 Content-Transfer-Encoding: base64
44 Content-Disposition: attachment; filename="smime.p7s"
45 Content-Description: (truncated) S/MIME Cryptographic Signature
47 dkTlB69771K2eXK4LcHSH/2LqX+VYa3K44vrx1ruzjXdNWzIpKBy0weFNiwnJCGofvCysM2RCSI1
48 --94eb2c0bc864b76ba30545b2bca9--
52 my @parts = $msg->subparts;
55 diff: document behavior of relative diff.orderFile
56 diff: document the pattern format for diff.orderFile
58 Documentation/diff-config.txt | 5 ++++-
59 Documentation/diff-options.txt | 3 ++-
60 2 files changed, 6 insertions(+), 2 deletions(-)
64 is($parts[0]->body, $exp, 'body matches expected');
67 Date: Wed, 18 Jan 2017 13:28:32 -0500
68 From: Santiago Torres <santiago@nyu.edu>
69 To: Junio C Hamano <gitster@pobox.com>
70 Cc: git@vger.kernel.org, peff@peff.net, sunshine@sunshineco.com,
71 walters@verbum.org, Lukas Puehringer <luk.puehringer@gmail.com>
72 Subject: Re: [PATCH v6 4/6] builtin/tag: add --format argument for tag -v
73 Message-ID: <20170118182831.pkhqu2np3bh2puei@LykOS.localdomain>
74 References: <20170117233723.23897-1-santiago@nyu.edu>
75 <20170117233723.23897-5-santiago@nyu.edu>
76 <xmqqmvepb4oj.fsf@gitster.mtv.corp.google.com>
77 <xmqqh94wb4y0.fsf@gitster.mtv.corp.google.com>
79 Content-Type: multipart/signed; micalg=pgp-sha256;
80 protocol="application/pgp-signature"; boundary="r24xguofrazenjwe"
81 Content-Disposition: inline
82 In-Reply-To: <xmqqh94wb4y0.fsf@gitster.mtv.corp.google.com>
86 Content-Type: text/plain; charset=us-ascii
87 Content-Disposition: inline
88 Content-Transfer-Encoding: quoted-printable
90 your tree directly?=20
93 Content-Type: application/pgp-signature; name="signature.asc"
95 -----BEGIN PGP SIGNATURE-----
98 -----END PGP SIGNATURE-----
104 $msg = $cls->new($raw);
107 my ($part, $level, @ex) = @{$_[0]};
108 is($level, 1, 'at expected level');
109 if (join('fail if $#ex > 0', @ex) eq '1') {
110 is($part->body_str, "your tree directly? \r\n",
112 } elsif (join('fail if $#ex > 0', @ex) eq '2') {
113 is($part->body, "-----BEGIN PGP SIGNATURE-----\n\n" .
115 "-----END PGP SIGNATURE-----\n",
118 fail "unexpected part\n";
123 is($nr, 2, 'got 2 parts');
124 is($msg->as_string, $raw,
125 'stringified sufficiently close to original');