From: Mark Walters Date: Sat, 25 Feb 2012 08:06:40 +0000 (+0000) Subject: [Patch v6 09/13] test: update tests to reflect the exclude flag X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=742c02a0e30332621328f8b4acecd4d8c58ff8ad;p=notmuch-archives.git [Patch v6 09/13] test: update tests to reflect the exclude flag --- diff --git a/47/58dede36e0e673c0b063b261ceba088591b955 b/47/58dede36e0e673c0b063b261ceba088591b955 new file mode 100644 index 000000000..107086831 --- /dev/null +++ b/47/58dede36e0e673c0b063b261ceba088591b955 @@ -0,0 +1,366 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1616C431FBD + for ; Sat, 25 Feb 2012 22:10:30 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.202 +X-Spam-Level: +X-Spam-Status: No, score=0.202 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + NORMAL_HTTP_TO_IP=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id XQUCXqOkfsoy for ; + Sat, 25 Feb 2012 22:10:28 -0800 (PST) +Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com + [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 1B23F431FAE + for ; Sat, 25 Feb 2012 22:10:27 -0800 (PST) +Received: by wibhi8 with SMTP id hi8so2577714wib.26 + for ; Sat, 25 Feb 2012 22:10:26 -0800 (PST) +Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates + 10.180.78.130 as permitted sender) client-ip=10.180.78.130; +Authentication-Results: mr.google.com; spf=pass (google.com: domain of + markwalters1009@gmail.com designates 10.180.78.130 as permitted + sender) smtp.mail=markwalters1009@gmail.com; + dkim=pass header.i=markwalters1009@gmail.com +Received: from mr.google.com ([10.180.78.130]) + by 10.180.78.130 with SMTP id b2mr8528667wix.1.1330236626990 (num_hops + = 1); Sat, 25 Feb 2012 22:10:26 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references + :mime-version:content-type:content-transfer-encoding; + bh=BoqCjvH/qrRodiooalUu9qeE1gyUo9xNYwfwn6Gk3Xo=; + b=ke8/12iTtA3pST28xDZEtIuqg+PnZkPVTlWLNocmgdMnlKINjaEGI58vDrqHzMOcFE + u+IClqwTSoZoXBbGbDRkAMM8lF3uWDRvKzjJWqS3ogAhdREnrftAhOW3ljFzZqqMtPtL + nkhBahAmBAweimFrVX1Tml2FKVWnBCDrRRC8g= +Received: by 10.180.78.130 with SMTP id b2mr1802693wix.1.1330157146854; + Sat, 25 Feb 2012 00:05:46 -0800 (PST) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + m16sm20598808wie.9.2012.02.25.00.05.45 (version=TLSv1/SSLv3 cipher=OTHER); + Sat, 25 Feb 2012 00:05:46 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org, + Austin Clements +Subject: [Patch v6 09/13] test: update tests to reflect the exclude flag +Date: Sat, 25 Feb 2012 08:06:40 +0000 +Message-Id: <1330157204-26094-10-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.2.3 +In-Reply-To: <1330157204-26094-1-git-send-email-markwalters1009@gmail.com> +References: <1330157204-26094-1-git-send-email-markwalters1009@gmail.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 26 Feb 2012 06:10:30 -0000 + +notmuch show outputs the exclude flag so many tests using notmuch +show failed. This commit adds "excluded:0" or "excluded: false" to +the expected outputs. After this commit there should be no failing +tests. +--- + test/crypto | 9 ++++++++- + test/encoding | 2 +- + test/json | 6 +++--- + test/maildir-sync | 1 + + test/multipart | 4 ++-- + test/thread-naming | 16 ++++++++-------- + 6 files changed, 23 insertions(+), 15 deletions(-) + +diff --git a/test/crypto b/test/crypto +index 1dbb60a..564cf9a 100755 +--- a/test/crypto ++++ b/test/crypto +@@ -43,6 +43,7 @@ output=$(notmuch show --format=json --verify subject:"test signed message 001" \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') + expected='[[[{"id": "XXXXX", + "match": true, ++ "excluded": false, + "filename": "YYYYY", + "timestamp": 946728000, + "date_relative": "2000-01-01", +@@ -77,6 +78,7 @@ output=$(notmuch show --format=json --verify subject:"test signed message 001" \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') + expected='[[[{"id": "XXXXX", + "match": true, ++ "excluded": false, + "filename": "YYYYY", + "timestamp": 946728000, + "date_relative": "2000-01-01", +@@ -113,6 +115,7 @@ output=$(notmuch show --format=json --verify subject:"test signed message 001" \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') + expected='[[[{"id": "XXXXX", + "match": true, ++ "excluded": false, + "filename": "YYYYY", + "timestamp": 946728000, + "date_relative": "2000-01-01", +@@ -153,7 +156,7 @@ test_begin_subtest "decryption, --format=text" + output=$(notmuch show --format=text --decrypt subject:"test encrypted message 001" \ + | notmuch_show_sanitize_all \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +-expected=' +message{ id:XXXXX depth:0 match:1 filename:XXXXX ++expected=' +message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX + +header{ + Notmuch Test Suite (2000-01-01) (encrypted inbox) + Subject: test encrypted message 001 +@@ -187,6 +190,7 @@ output=$(notmuch show --format=json --decrypt subject:"test encrypted message 00 + | sed -e 's|"created": [1234567890]*|"created": 946728000|') + expected='[[[{"id": "XXXXX", + "match": true, ++ "excluded": false, + "filename": "YYYYY", + "timestamp": 946728000, + "date_relative": "2000-01-01", +@@ -242,6 +246,7 @@ output=$(notmuch show --format=json --decrypt subject:"test encrypted message 00 + | sed -e 's|"created": [1234567890]*|"created": 946728000|') + expected='[[[{"id": "XXXXX", + "match": true, ++ "excluded": false, + "filename": "YYYYY", + "timestamp": 946728000, + "date_relative": "2000-01-01", +@@ -277,6 +282,7 @@ output=$(notmuch show --format=json --decrypt subject:"test encrypted message 00 + | sed -e 's|"created": [1234567890]*|"created": 946728000|') + expected='[[[{"id": "XXXXX", + "match": true, ++ "excluded": false, + "filename": "YYYYY", + "timestamp": 946728000, + "date_relative": "2000-01-01", +@@ -332,6 +338,7 @@ output=$(notmuch show --format=json --verify subject:"test signed message 001" \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') + expected='[[[{"id": "XXXXX", + "match": true, ++ "excluded": false, + "filename": "YYYYY", + "timestamp": 946728000, + "date_relative": "2000-01-01", +diff --git a/test/encoding b/test/encoding +index 33259c1..a872345 100755 +--- a/test/encoding ++++ b/test/encoding +@@ -6,7 +6,7 @@ test_begin_subtest "Message with text of unknown charset" + add_message '[content-type]="text/plain; charset=unknown-8bit"' \ + "[body]=irrelevant" + output=$(notmuch show id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) +-test_expect_equal "$output" " +message{ id:msg-001@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-001 ++test_expect_equal "$output" " +message{ id:msg-001@notmuch-test-suite depth:0 match:1 excluded:0 filename:/XXX/mail/msg-001 + +header{ + Notmuch Test Suite (2001-01-05) (inbox unread) + Subject: Test message #1 +diff --git a/test/json b/test/json +index 7df4380..f95fcf8 100755 +--- a/test/json ++++ b/test/json +@@ -5,7 +5,7 @@ test_description="--format=json output" + test_begin_subtest "Show message: json" + add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-show-message\"" + output=$(notmuch show --format=json "json-show-message") +-test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" ++test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" + + test_begin_subtest "Search message: json" + add_message "[subject]=\"json-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-search-message\"" +@@ -22,7 +22,7 @@ test_expect_equal "$output" "[{\"thread\": \"XXX\", + test_begin_subtest "Show message: json, utf-8" + add_message "[subject]=\"json-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-show-méssage\"" + output=$(notmuch show --format=json "jsön-show-méssage") +-test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-utf8-body-sübjéct\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"jsön-show-méssage\n\"}]}, []]]]" ++test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-utf8-body-sübjéct\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"jsön-show-méssage\n\"}]}, []]]]" + + test_begin_subtest "Show message: json, inline attachment filename" + subject='json-show-inline-attachment-filename' +@@ -35,7 +35,7 @@ emacs_deliver_message \ + (insert \"Message-ID: <$id>\n\")" + output=$(notmuch show --format=json "id:$id") + filename=$(notmuch search --output=files "id:$id") +-test_expect_equal "$output" "[[[{\"id\": \"$id\", \"match\": true, \"filename\": \"$filename\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\"], \"headers\": {\"Subject\": \"$subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"test_suite@notmuchmail.org\", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"multipart/mixed\", \"content\": [{\"id\": 2, \"content-type\": \"text/plain\", \"content\": \"This is a test message with inline attachment with a filename\"}, {\"id\": 3, \"content-type\": \"application/octet-stream\", \"filename\": \"README\"}]}]}, []]]]" ++test_expect_equal "$output" "[[[{\"id\": \"$id\", \"match\": true, \"excluded\": false, \"filename\": \"$filename\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\"], \"headers\": {\"Subject\": \"$subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"test_suite@notmuchmail.org\", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"multipart/mixed\", \"content\": [{\"id\": 2, \"content-type\": \"text/plain\", \"content\": \"This is a test message with inline attachment with a filename\"}, {\"id\": 3, \"content-type\": \"application/octet-stream\", \"filename\": \"README\"}]}]}, []]]]" + + test_begin_subtest "Search message: json, utf-8" + add_message "[subject]=\"json-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-search-méssage\"" +diff --git a/test/maildir-sync b/test/maildir-sync +index d5872a5..dfa3966 100755 +--- a/test/maildir-sync ++++ b/test/maildir-sync +@@ -46,6 +46,7 @@ test_begin_subtest "notmuch show works with renamed file (without notmuch new)" + output=$(notmuch show --format=json id:${gen_msg_id} | filter_show_json) + test_expect_equal "$output" '[[[{"id": "adding-replied-tag@notmuch-test-suite", + "match": true, ++"excluded": false, + "filename": "MAIL_DIR/cur/adding-replied-tag:2,RS", + "timestamp": 978709437, + "date_relative": "2001-01-05", +diff --git a/test/multipart b/test/multipart +index 2dd73f5..3d2dcfc 100755 +--- a/test/multipart ++++ b/test/multipart +@@ -108,7 +108,7 @@ notmuch new > /dev/null + test_begin_subtest "--format=text --part=0, full message" + notmuch show --format=text --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT + cat <EXPECTED +- +message{ id:87liy5ap00.fsf@yoom.home.cworth.org depth:0 match:1 filename:${MAIL_DIR}/multipart ++ +message{ id:87liy5ap00.fsf@yoom.home.cworth.org depth:0 match:1 excluded:0 filename:${MAIL_DIR}/multipart + +header{ + Carl Worth (2001-01-05) (attachment inbox signed unread) + Subject: Multipart message +@@ -322,7 +322,7 @@ notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' | s + echo >>OUTPUT # expect *no* newline at end of output + cat <EXPECTED + +-{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "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", "Cc": "", "Bcc": "", "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", "Cc": "", "Bcc": "", "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": {"From": "Carl Worth ", "To": "cworth@cworth.org", "Subject": "html message", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ +diff --git a/test/thread-naming b/test/thread-naming +index 942e593..1a1a48f 100755 +--- a/test/thread-naming ++++ b/test/thread-naming +@@ -65,7 +65,7 @@ test_expect_equal "$output" "thread:XXX 2001-01-12 [6/8] Notmuch Test Suite; t + + test_begin_subtest 'Test order of messages in "notmuch show"' + output=$(notmuch show thread-naming | notmuch_show_sanitize) +-test_expect_equal "$output" " +message{ id:msg-$(printf "%03d" $first)@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-$(printf "%03d" $first) ++test_expect_equal "$output" " +message{ id:msg-$(printf "%03d" $first)@notmuch-test-suite depth:0 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $first) + +header{ + Notmuch Test Suite (2001-01-05) (unread) + Subject: thread-naming: Initial thread subject +@@ -79,7 +79,7 @@ This is just a test message (#$first) + +part} + +body} + +message} +- +message{ id:msg-$(printf "%03d" $((first + 1)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 1))) ++ +message{ id:msg-$(printf "%03d" $((first + 1)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 1))) + +header{ + Notmuch Test Suite (2001-01-06) (inbox unread) + Subject: thread-naming: Older changed subject +@@ -93,7 +93,7 @@ This is just a test message (#$((first + 1))) + +part} + +body} + +message} +- +message{ id:msg-$(printf "%03d" $((first + 2)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 2))) ++ +message{ id:msg-$(printf "%03d" $((first + 2)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 2))) + +header{ + Notmuch Test Suite (2001-01-07) (inbox unread) + Subject: thread-naming: Newer changed subject +@@ -107,7 +107,7 @@ This is just a test message (#$((first + 2))) + +part} + +body} + +message} +- +message{ id:msg-$(printf "%03d" $((first + 3)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 3))) ++ +message{ id:msg-$(printf "%03d" $((first + 3)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 3))) + +header{ + Notmuch Test Suite (2001-01-08) (unread) + Subject: thread-naming: Final thread subject +@@ -121,7 +121,7 @@ This is just a test message (#$((first + 3))) + +part} + +body} + +message} +- +message{ id:msg-$(printf "%03d" $((first + 4)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 4))) ++ +message{ id:msg-$(printf "%03d" $((first + 4)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 4))) + +header{ + Notmuch Test Suite (2001-01-09) (inbox unread) + Subject: Re: thread-naming: Initial thread subject +@@ -135,7 +135,7 @@ This is just a test message (#$((first + 4))) + +part} + +body} + +message} +- +message{ id:msg-$(printf "%03d" $((first + 5)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 5))) ++ +message{ id:msg-$(printf "%03d" $((first + 5)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 5))) + +header{ + Notmuch Test Suite (2001-01-10) (inbox unread) + Subject: Aw: thread-naming: Initial thread subject +@@ -149,7 +149,7 @@ This is just a test message (#$((first + 5))) + +part} + +body} + +message} +- +message{ id:msg-$(printf "%03d" $((first + 6)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 6))) ++ +message{ id:msg-$(printf "%03d" $((first + 6)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 6))) + +header{ + Notmuch Test Suite (2001-01-11) (inbox unread) + Subject: Vs: thread-naming: Initial thread subject +@@ -163,7 +163,7 @@ This is just a test message (#$((first + 6))) + +part} + +body} + +message} +- +message{ id:msg-$(printf "%03d" $((first + 7)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 7))) ++ +message{ id:msg-$(printf "%03d" $((first + 7)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 7))) + +header{ + Notmuch Test Suite (2001-01-12) (inbox unread) + Subject: Sv: thread-naming: Initial thread subject +-- +1.7.2.3 +