1 # Copyright (C) 2017-2019 all contributors <meta@public-inbox.org>
2 # This library is free software; you can redistribute it and/or modify
3 # it under the same terms as Perl itself.
4 # Artistic or GPL-1+ <https://www.gnu.org/licenses/gpl-1.0.txt>
8 use_ok 'PublicInbox::MIME';
9 use PublicInbox::MsgIter;
11 local $SIG{__WARN__} = sub {};
12 my $msg = PublicInbox::MIME->new(
13 'From: Richard Hansen <hansenr@google.com>
14 To: git@vger.kernel.org
15 Cc: Richard Hansen <hansenr@google.com>
16 Subject: [PATCH 0/2] minor diff orderfile documentation improvements
17 Date: Mon, 9 Jan 2017 19:40:29 -0500
18 Message-Id: <20170110004031.57985-1-hansenr@google.com>
19 X-Mailer: git-send-email 2.11.0.390.gc69c2f50cf-goog
20 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256;
21 boundary="94eb2c0bc864b76ba30545b2bca9"
23 --94eb2c0bc864b76ba30545b2bca9
26 diff: document behavior of relative diff.orderFile
27 diff: document the pattern format for diff.orderFile
29 Documentation/diff-config.txt | 5 ++++-
30 Documentation/diff-options.txt | 3 ++-
31 2 files changed, 6 insertions(+), 2 deletions(-)
34 --94eb2c0bc864b76ba30545b2bca9
35 Content-Type: application/pkcs7-signature; name="smime.p7s"
36 Content-Transfer-Encoding: base64
37 Content-Disposition: attachment; filename="smime.p7s"
38 Content-Description: (truncated) S/MIME Cryptographic Signature
40 dkTlB69771K2eXK4LcHSH/2LqX+VYa3K44vrx1ruzjXdNWzIpKBy0weFNiwnJCGofvCysM2RCSI1
41 --94eb2c0bc864b76ba30545b2bca9--
45 my @parts = $msg->parts;
46 my $exp = 'Richard Hansen (2):
47 diff: document behavior of relative diff.orderFile
48 diff: document the pattern format for diff.orderFile
50 Documentation/diff-config.txt | 5 ++++-
51 Documentation/diff-options.txt | 3 ++-
52 2 files changed, 6 insertions(+), 2 deletions(-)
56 ok($msg->isa('Email::MIME'), 'compatible with Email::MIME');
57 is($parts[0]->body, $exp, 'body matches expected');
60 my $raw = q^Date: Wed, 18 Jan 2017 13:28:32 -0500
61 From: Santiago Torres <santiago@nyu.edu>
62 To: Junio C Hamano <gitster@pobox.com>
63 Cc: git@vger.kernel.org, peff@peff.net, sunshine@sunshineco.com,
64 walters@verbum.org, Lukas Puehringer <luk.puehringer@gmail.com>
65 Subject: Re: [PATCH v6 4/6] builtin/tag: add --format argument for tag -v
66 Message-ID: <20170118182831.pkhqu2np3bh2puei@LykOS.localdomain>
67 References: <20170117233723.23897-1-santiago@nyu.edu>
68 <20170117233723.23897-5-santiago@nyu.edu>
69 <xmqqmvepb4oj.fsf@gitster.mtv.corp.google.com>
70 <xmqqh94wb4y0.fsf@gitster.mtv.corp.google.com>
72 Content-Type: multipart/signed; micalg=pgp-sha256;
73 protocol="application/pgp-signature"; boundary="r24xguofrazenjwe"
74 Content-Disposition: inline
75 In-Reply-To: <xmqqh94wb4y0.fsf@gitster.mtv.corp.google.com>
79 Content-Type: text/plain; charset=us-ascii
80 Content-Disposition: inline
81 Content-Transfer-Encoding: quoted-printable
83 your tree directly?=20
86 Content-Type: application/pgp-signature; name="signature.asc"
88 -----BEGIN PGP SIGNATURE-----
91 -----END PGP SIGNATURE-----
97 $msg = PublicInbox::MIME->new($raw);
100 my ($part, $level, @ex) = @{$_[0]};
102 is($part->body_str, "your tree directly? \r\n", 'body OK');
103 } elsif ($ex[0] == 2) {
104 is($part->body, "-----BEGIN PGP SIGNATURE-----\n\n" .
106 "-----END PGP SIGNATURE-----\n",
109 fail "unexpected part\n";
114 is($nr, 2, 'got 2 parts');
115 is($msg->as_string, $raw,
116 'stringified sufficiently close to original');