[PATCH v2 2/4] test: add tests for the new --body=true|false option
authorMark Walters <markwalters1009@gmail.com>
Mon, 23 Jul 2012 17:57:37 +0000 (18:57 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:30 +0000 (09:48 -0800)
7b/9d63593a58f6e2f26844ac1be1d92a0a484159 [new file with mode: 0644]

diff --git a/7b/9d63593a58f6e2f26844ac1be1d92a0a484159 b/7b/9d63593a58f6e2f26844ac1be1d92a0a484159
new file mode 100644 (file)
index 0000000..7a0b6e7
--- /dev/null
@@ -0,0 +1,89 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1C505431FD0\r
+       for <notmuch@notmuchmail.org>; Mon, 23 Jul 2012 10:57:53 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 5OmBxN6YBiSK for <notmuch@notmuchmail.org>;\r
+       Mon, 23 Jul 2012 10:57:51 -0700 (PDT)\r
+Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 7C991431FC4\r
+       for <notmuch@notmuchmail.org>; Mon, 23 Jul 2012 10:57:47 -0700 (PDT)\r
+Received: by mail-we0-f181.google.com with SMTP id t57so4988618wey.26\r
+       for <notmuch@notmuchmail.org>; Mon, 23 Jul 2012 10:57:47 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=yfYE+//obOnHYjfRaSnSSvMW9cPetGf0Y1+gUFlfj64=;\r
+       b=SrG7Skykhn/WYEtZUkBlN1hE18auPEypx9vdX1DEmOLk500ebsPZ+tRkFUvW3w+9eg\r
+       +trjEUD4hy0MS2SIRDIAoNlnNW4RzV7KFDezlFr9ay2WNPynqLNmswmgB+Qzl8O2QUCd\r
+       QWXZmBfmUt9qfreyI9MgSneYHTYMMzd1uZSCIKrd8Ne3nRu3QsfdiKqa2/8txki9tmpN\r
+       ISfUJ8ttwZHhgRxqbvg6SkYXHJXfdKnOnh643ScbzIOAVXgV6QjGIX4a8YNvPq5+ZHWE\r
+       Cj4CHDTOslJb4lVK5XUf6X3hEhvJUvkR5QN3KPdI46I8e/YInPhVnDFxoIxpoYtj9H44\r
+       al+g==\r
+Received: by 10.180.81.133 with SMTP id a5mr32057454wiy.17.1343066267123;\r
+       Mon, 23 Jul 2012 10:57:47 -0700 (PDT)\r
+Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
+ [94.192.233.223])     by mx.google.com with ESMTPS id\r
+ cl8sm18011864wib.10.2012.07.23.10.57.45       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 23 Jul 2012 10:57:46 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 2/4] test: add tests for the new --body=true|false option\r
+Date: Mon, 23 Jul 2012 18:57:37 +0100\r
+Message-Id: <1343066259-22523-3-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1343066259-22523-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1343066259-22523-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 23 Jul 2012 17:57:53 -0000\r
+\r
+---\r
+ test/json |    9 +++++++++\r
+ 1 files changed, 9 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/json b/test/json\r
+index 6439788..709b34f 100755\r
+--- a/test/json\r
++++ b/test/json\r
+@@ -7,6 +7,15 @@ add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:0\r
+ output=$(notmuch show --format=json "json-show-message")\r
+ 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 <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]"\r
\r
++# This should be the same output as above.\r
++test_begin_subtest "Show message: json --body=true"\r
++output=$(notmuch show --format=json --body=true "json-show-message")\r
++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 <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]"\r
++\r
++test_begin_subtest "Show message: json --body=false"\r
++output=$(notmuch show --format=json --body=false "json-show-message")\r
++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 <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}}, []]]]"\r
++\r
+ test_begin_subtest "Search message: json"\r
+ add_message "[subject]=\"json-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-search-message\""\r
+ output=$(notmuch search --format=json "json-search-message" | notmuch_search_sanitize)\r
+-- \r
+1.7.9.1\r
+\r