[PATCH 1/1] Fixing failing JSON tests.
authorPeter Feigl <craven@gmx.net>
Tue, 4 Dec 2012 13:46:45 +0000 (14:46 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:51:26 +0000 (09:51 -0800)
50/8b6c01c11e31097bb88af613a53d6d8a248f31 [new file with mode: 0644]

diff --git a/50/8b6c01c11e31097bb88af613a53d6d8a248f31 b/50/8b6c01c11e31097bb88af613a53d6d8a248f31
new file mode 100644 (file)
index 0000000..cf0c709
--- /dev/null
@@ -0,0 +1,85 @@
+Return-Path: <nex@nexoid.at>\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 B6FD1431FB6\r
+       for <notmuch@notmuchmail.org>; Tue,  4 Dec 2012 05:46:58 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.001\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.001 tagged_above=-999 required=5\r
+       tests=[FREEMAIL_FROM=0.001] 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 iV3MG3RbvVzd for <notmuch@notmuchmail.org>;\r
+       Tue,  4 Dec 2012 05:46:54 -0800 (PST)\r
+Received: from mail.nexoid.at (www.nexoid.at [178.79.130.240])\r
+       (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 7E505431FAE\r
+       for <notmuch@notmuchmail.org>; Tue,  4 Dec 2012 05:46:54 -0800 (PST)\r
+Received: by mail.nexoid.at (Postfix, from userid 1000)\r
+       id 6F4AA11C109; Tue,  4 Dec 2012 14:46:51 +0100 (CET)\r
+From: Peter Feigl <craven@gmx.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: =?UTF-8?q?=5BPATCH=201/1=5D=20Fixing=20failing=20JSON=20tests=2E?=\r
+Date: Tue,  4 Dec 2012 14:46:45 +0100\r
+Message-Id: <1354628805-2148-1-git-send-email-craven@gmx.net>\r
+X-Mailer: git-send-email 1.8.0\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\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: Tue, 04 Dec 2012 13:46:58 -0000\r
+\r
+Two --format=json tests were failing, both due changes in the output\r
+format introduced by the structured formatting code. This patch updates\r
+the expected output.\r
+---\r
+ test/json | 12 ++----------\r
+ 1 file changed, 2 insertions(+), 10 deletions(-)\r
+\r
+diff --git a/test/json b/test/json\r
+index bfafd55..75b732f 100755\r
+--- a/test/json\r
++++ b/test/json\r
+@@ -32,7 +32,7 @@ test_expect_equal_json "$output" "[{\"thread\": \"XXX\",\r
+ test_begin_subtest "Show message: json, utf-8"\r
+ 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\""\r
+ output=$(notmuch show --format=json "jsön-show-méssage")\r
+-test_expect_equal_json "$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 <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\": \"jsön-show-méssage\n\"}]}, []]]]"\r
++test_expect_equal_json "$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 <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\": \"jsön-show-méssage\n\"}]}, []]]]"\r
\r
+ test_begin_subtest "Show message: json, inline attachment filename"\r
+ subject='json-show-inline-attachment-filename'\r
+@@ -50,14 +50,6 @@ test_expect_equal_json "$output" "[[[{\"id\": \"$id\", \"match\": true, \"exclud\r
+ test_begin_subtest "Search message: json, utf-8"\r
+ 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\""\r
+ output=$(notmuch search --format=json "jsön-search-méssage" | notmuch_search_sanitize)\r
+-test_expect_equal_json "$output" "[{\"thread\": \"XXX\",\r
+- \"timestamp\": 946728000,\r
+- \"date_relative\": \"2000-01-01\",\r
+- \"matched\": 1,\r
+- \"total\": 1,\r
+- \"authors\": \"Notmuch Test Suite\",\r
+- \"subject\": \"json-search-utf8-body-sübjéct\",\r
+- \"tags\": [\"inbox\",\r
+- \"unread\"]}]"\r
++test_expect_equal_json "$output" "[{\"thread\": \"XXX\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"matched\": 1, \"total\": 1, \"authors\": \"Notmuch Test Suite\", \"subject\": \"json-search-utf8-body-sübjéct\", \"tags\": [\"inbox\", \"unread\"]}]"\r
\r
+ test_done\r
+-- \r
+1.8.0\r
+\r