[PATCH 4/4] test: conform to content-length fields (text)

Subject: [PATCH 4/4] test: conform to content-length fields (text)

Date: Sun, 5 Aug 2012 17:22:25 +1000

To: notmuch@notmuchmail.org

Cc:

From: Peter Wang


Update tests to expect Content-length fields in show --format=text
output, for leaf parts with omitted body content.
---
 test/crypto    |    4 ++--
 test/multipart |   18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/test/crypto b/test/crypto
index 4a73dcc..8dfbfa6 100755
--- a/test/crypto
+++ b/test/crypto
@@ -161,14 +161,14 @@ Date: Sat, 01 Jan 2000 12:00:00 +0000
 header}
 body{
 part{ ID: 1, Content-type: multipart/encrypted
-part{ ID: 2, Content-type: application/pgp-encrypted
+part{ ID: 2, Content-type: application/pgp-encrypted, Content-length: 11
 Non-text part: application/pgp-encrypted
 part}
 part{ ID: 3, Content-type: multipart/mixed
 part{ ID: 4, Content-type: text/plain
 This is a test encrypted message.
 part}
-attachment{ ID: 5, Filename: TESTATTACHMENT, Content-type: application/octet-stream
+attachment{ ID: 5, Filename: TESTATTACHMENT, Content-type: application/octet-stream, Content-length: 28
 Non-text part: application/octet-stream
 attachment}
 part}
diff --git a/test/multipart b/test/multipart
index 0f9e113..064e91a 100755
--- a/test/multipart
+++ b/test/multipart
@@ -129,7 +129,7 @@ Date: Fri, 05 Jan 2001 15:42:57 +0000
 header}
 body{
 part{ ID: 4, Content-type: multipart/alternative
-part{ ID: 5, Content-type: text/html
+part{ ID: 5, Content-type: text/html, Content-length: 71
 Non-text part: text/html
 part}
 part{ ID: 6, Content-type: text/plain
@@ -147,7 +147,7 @@ And this message is signed.
 -Carl
 part}
 part}
-part{ ID: 9, Content-type: application/pgp-signature
+part{ ID: 9, Content-type: application/pgp-signature, Content-length: 197
 Non-text part: application/pgp-signature
 part}
 part}
@@ -170,7 +170,7 @@ Date: Fri, 05 Jan 2001 15:42:57 +0000
 header}
 body{
 part{ ID: 4, Content-type: multipart/alternative
-part{ ID: 5, Content-type: text/html
+part{ ID: 5, Content-type: text/html, Content-length: 71
 Non-text part: text/html
 part}
 part{ ID: 6, Content-type: text/plain
@@ -188,7 +188,7 @@ And this message is signed.
 -Carl
 part}
 part}
-part{ ID: 9, Content-type: application/pgp-signature
+part{ ID: 9, Content-type: application/pgp-signature, Content-length: 197
 Non-text part: application/pgp-signature
 part}
 part}
@@ -208,7 +208,7 @@ Date: Fri, 05 Jan 2001 15:42:57 +0000
 header}
 body{
 part{ ID: 4, Content-type: multipart/alternative
-part{ ID: 5, Content-type: text/html
+part{ ID: 5, Content-type: text/html, Content-length: 71
 Non-text part: text/html
 part}
 part{ ID: 6, Content-type: text/plain
@@ -241,7 +241,7 @@ Date: Fri, 05 Jan 2001 15:42:57 +0000
 header}
 body{
 part{ ID: 4, Content-type: multipart/alternative
-part{ ID: 5, Content-type: text/html
+part{ ID: 5, Content-type: text/html, Content-length: 71
 Non-text part: text/html
 part}
 part{ ID: 6, Content-type: text/plain
@@ -257,7 +257,7 @@ test_begin_subtest "--format=text --part=4, rfc822's multipart"
 notmuch show --format=text --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
 cat <<EOF >EXPECTED
 part{ ID: 4, Content-type: multipart/alternative
-part{ ID: 5, Content-type: text/html
+part{ ID: 5, Content-type: text/html, Content-length: 71
 Non-text part: text/html
 part}
 part{ ID: 6, Content-type: text/plain
@@ -270,7 +270,7 @@ test_expect_equal_file OUTPUT EXPECTED
 test_begin_subtest "--format=text --part=5, rfc822's html part"
 notmuch show --format=text --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
 cat <<EOF >EXPECTED
-part{ ID: 5, Content-type: text/html
+part{ ID: 5, Content-type: text/html, Content-length: 71
 Non-text part: text/html
 part}
 EOF
@@ -308,7 +308,7 @@ test_expect_equal_file OUTPUT EXPECTED
 test_begin_subtest "--format=text --part=9, pgp signature (unverified)"
 notmuch show --format=text --part=9 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
 cat <<EOF >EXPECTED
-part{ ID: 9, Content-type: application/pgp-signature
+part{ ID: 9, Content-type: application/pgp-signature, Content-length: 197
 Non-text part: application/pgp-signature
 part}
 EOF
-- 
1.7.4.4


Thread: