X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT190-multipart.sh;h=a6b155e9c7a82d0ca3b15b8457ef132f7c482a74;hp=1caf6831b7c0ed01fe7000260f00ac801539e265;hb=a8a270522231b186493ecd97d56a1343382d51d8;hpb=c1c955786ae1a828f09fd49d7b996dce624ee682 diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh index 1caf6831..a6b155e9 100755 --- a/test/T190-multipart.sh +++ b/test/T190-multipart.sh @@ -338,21 +338,20 @@ Non-text part: application/pgp-signature EOF test_expect_equal_file OUTPUT EXPECTED -test_expect_success \ - "--format=text --part=8, no part, expect error" \ - "notmuch show --format=text --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org'" +test_begin_subtest "--format=text --part=8, no part, expect error" +test_expect_success "notmuch show --format=text --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org'" test_begin_subtest "--format=json --part=0, full message" notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT cat <EXPECTED -{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "excluded": false, "filename": "${MAIL_DIR}/multipart", "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [ +{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "excluded": false, "filename": ["${MAIL_DIR}/multipart"], "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [ {"id": 1, "content-type": "multipart/signed", "content": [ {"id": 2, "content-type": "multipart/mixed", "content": [ -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ +{"id": 3, "content-type": "message/rfc822", "content-disposition": "inline", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ {"id": 4, "content-type": "multipart/alternative", "content": [ {"id": 5, "content-type": "text/html", "content-length": 71}, {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, -{"id": 7, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"}, +{"id": 7, "content-type": "text/plain", "content-disposition": "attachment", "filename": "attachment", "content": "This is a text attachment.\n"}, {"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}]}, {"id": 9, "content-type": "application/pgp-signature", "content-length": 197}]}]} EOF @@ -363,11 +362,11 @@ notmuch show --format=json --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OU cat <EXPECTED {"id": 1, "content-type": "multipart/signed", "content": [ {"id": 2, "content-type": "multipart/mixed", "content": [ -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ +{"id": 3, "content-type": "message/rfc822", "content-disposition": "inline", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ {"id": 4, "content-type": "multipart/alternative", "content": [ {"id": 5, "content-type": "text/html", "content-length": 71}, {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, -{"id": 7, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"}, +{"id": 7, "content-type": "text/plain", "content-disposition": "attachment", "filename": "attachment", "content": "This is a text attachment.\n"}, {"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}]}, {"id": 9, "content-type": "application/pgp-signature", "content-length": 197}]} EOF @@ -377,11 +376,11 @@ test_begin_subtest "--format=json --part=2, multipart/mixed" notmuch show --format=json --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT cat <EXPECTED {"id": 2, "content-type": "multipart/mixed", "content": [ -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ +{"id": 3, "content-type": "message/rfc822", "content-disposition": "inline", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ {"id": 4, "content-type": "multipart/alternative", "content": [ {"id": 5, "content-type": "text/html", "content-length": 71}, {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, -{"id": 7, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"}, +{"id": 7, "content-type": "text/plain", "content-disposition": "attachment", "filename": "attachment", "content": "This is a text attachment.\n"}, {"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}]} EOF test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" @@ -389,7 +388,7 @@ test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" test_begin_subtest "--format=json --part=3, rfc822 part" notmuch show --format=json --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT cat <EXPECTED -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ +{"id": 3, "content-type": "message/rfc822", "content-disposition": "inline", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ {"id": 4, "content-type": "multipart/alternative", "content": [ {"id": 5, "content-type": "text/html", "content-length": 71}, {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]} @@ -422,7 +421,11 @@ test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" test_begin_subtest "--format=json --part=7, inline attachment" notmuch show --format=json --part=7 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT cat <EXPECTED -{"id": 7, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"} +{"id": 7, + "content-type": "text/plain", + "filename": "attachment", + "content": "This is a text attachment.\n", + "content-disposition": "attachment"} EOF test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" @@ -440,9 +443,8 @@ cat <EXPECTED EOF test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" -test_expect_success \ - "--format=json --part=10, no part, expect error" \ - "notmuch show --format=json --part=10 'id:87liy5ap00.fsf@yoom.home.cworth.org'" +test_begin_subtest "--format=json --part=10, no part, expect error" +test_expect_success "notmuch show --format=json --part=10 'id:87liy5ap00.fsf@yoom.home.cworth.org'" test_begin_subtest "--format=raw" notmuch show --format=raw 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT @@ -576,9 +578,8 @@ W6cAmQE4dcYrx/LPLtYLZm1jsGauE5hE EOF test_expect_equal_file OUTPUT EXPECTED -test_expect_success \ - "--format=raw --part=10, no part, expect error" \ - "notmuch show --format=raw --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org'" +test_begin_subtest "--format=raw --part=10, no part, expect error" +test_expect_success "notmuch show --format=raw --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org'" test_begin_subtest "--format=mbox" notmuch show --format=mbox 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT @@ -588,9 +589,8 @@ cat "${MAIL_DIR}"/multipart >>EXPECTED echo >>EXPECTED test_expect_equal_file OUTPUT EXPECTED -test_expect_success \ - "--format=mbox --part=1, incompatible, expect error" \ - "! notmuch show --format=mbox --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org'" +test_begin_subtest "--format=mbox --part=1, incompatible, expect error" +test_expect_success "! notmuch show --format=mbox --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org'" test_begin_subtest "'notmuch reply' to a multipart message" notmuch reply 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT @@ -627,7 +627,7 @@ notmuch_json_show_sanitize <EXPECTED "original": {"id": "XXXXX", "match": false, "excluded": false, - "filename": "YYYYY", + "filename": ["YYYYY"], "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], @@ -641,6 +641,7 @@ notmuch_json_show_sanitize <EXPECTED "content-type": "multipart/mixed", "content": [{"id": 3, "content-type": "message/rfc822", + "content-disposition": "inline", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth ", "To": "cworth@cworth.org", @@ -655,6 +656,7 @@ notmuch_json_show_sanitize <EXPECTED "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, {"id": 7, "content-type": "text/plain", + "content-disposition": "attachment", "filename": "attachment", "content": "This is a text attachment.\n"}, {"id": 8, @@ -715,7 +717,7 @@ cat_expected_head () cat <", "Subject": "html message", "To": "B "}, @@ -764,7 +766,6 @@ output=$(notmuch search from:todd and mimetype:multipart/alternative | notmuch_s test_expect_equal "$output" "thread:XXX 2014-01-12 [1/1] Todd; odd content types (inbox unread)" test_begin_subtest "case of Content-Disposition doesn't matter for indexing" -test_subtest_known_broken cat < ${MAIL_DIR}/content-disposition Return-path: Envelope-to: david@tethera.net