Re: [PATCH 1/3] test: add basic show, search --format=text tests
authorAustin Clements <amdragon@MIT.EDU>
Wed, 4 Jul 2012 02:04:27 +0000 (22:04 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:47:58 +0000 (09:47 -0800)
5f/64675f8073ef15cb8b2a532232643d84abc8f1 [new file with mode: 0644]

diff --git a/5f/64675f8073ef15cb8b2a532232643d84abc8f1 b/5f/64675f8073ef15cb8b2a532232643d84abc8f1
new file mode 100644 (file)
index 0000000..038387b
--- /dev/null
@@ -0,0 +1,182 @@
+Return-Path: <amdragon@mit.edu>\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 6869E431FB6\r
+       for <notmuch@notmuchmail.org>; Tue,  3 Jul 2012 19:04:31 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[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 CRbVN8VT4NP2 for <notmuch@notmuchmail.org>;\r
+       Tue,  3 Jul 2012 19:04:30 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU\r
+       [18.9.25.13])\r
+       by olra.theworths.org (Postfix) with ESMTP id 7E421431FAE\r
+       for <notmuch@notmuchmail.org>; Tue,  3 Jul 2012 19:04:30 -0700 (PDT)\r
+X-AuditID: 1209190d-b7fd56d000000933-4a-4ff3a4ad76a8\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 4B.07.02355.DA4A3FF4; Tue,  3 Jul 2012 22:04:29 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q6424Ttf008907; \r
+       Tue, 3 Jul 2012 22:04:29 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6424RUc009966\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Tue, 3 Jul 2012 22:04:28 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1SmEx9-0006Ed-Ih; Tue, 03 Jul 2012 22:04:27 -0400\r
+Date: Tue, 3 Jul 2012 22:04:27 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Peter Wang <novalazy@gmail.com>\r
+Subject: Re: [PATCH 1/3] test: add basic show, search --format=text tests\r
+Message-ID: <20120704020427.GA21653@mit.edu>\r
+References: <1340508470-16606-1-git-send-email-novalazy@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=iso-8859-1\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: 8bit\r
+In-Reply-To: <1340508470-16606-1-git-send-email-novalazy@gmail.com>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFprJKsWRmVeSWpSXmKPExsUixG6nrrt2yWd/g50rbCyu35zJbPG8dS+T\r
+       A5PHzll32T2erbrFHMAUxWWTkpqTWZZapG+XwJWxe95s1oKP0hVrZ8k1MK4X72Lk5JAQMJH4\r
+       ffYKK4QtJnHh3nq2LkYuDiGBfYwSz9peMUE46xklNn47AuWcYJJYv3MvC4SzhFHiyZ197CD9\r
+       LAIqEhtuXmMDsdkENCS27V/OCGKLCChL/Pn1DCzOLCAt8e13MxOILSzgKXH53k+gGg4OXgEd\r
+       idlrFUBMIQEnifUby0AqeAUEJU7OfMIC0akjsXPrHTaQEpApy/9xQITlJZq3zmYGsTkFnCW2\r
+       3N4LNlwU6JgpJ7exTWAUnoVk0iwkk2YhTJqFZNICRpZVjLIpuVW6uYmZOcWpybrFyYl5ealF\r
+       ukZ6uZkleqkppZsYQTHAKcm7g/HdQaVDjAIcjEo8vIkKn/2FWBPLiitzDzFKcjApifIumwkU\r
+       4kvKT6nMSCzOiC8qzUktPsQowcGsJMK7Ogkox5uSWFmVWpQPk5LmYFES572SctNfSCA9sSQ1\r
+       OzW1ILUIJivDwaEkwXtuMVCjYFFqempFWmZOCUKaiYMTZDgP0HAbkBre4oLE3OLMdIj8KUZF\r
+       KXHeCpCEAEgiozQPrheWol4xigO9Isz7E6SKB5je4LpfAQ1mAhqct/gTyOCSRISUVAOj5r3V\r
+       33UnWSrsbOEPVbnkF8Et+DJC9LqP3Zt/Sz6ebHsQ0qpRUGIikytdYbhuUoPhhgj2F1ViJ8Rs\r
+       VeO3sX94FdhzQzn7Z+Lu7bf6vvicb/9za76TGPeqFLVod6l9PkI5OoWP37r27XH+tDlbOPuV\r
+       0Ua95bo71cq15yzO37jCOvrMVyO3+lolluKMREMt5qLiRAAdRjUALAMAAA==\r
+Cc: notmuch@notmuchmail.org\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: Wed, 04 Jul 2012 02:04:31 -0000\r
+\r
+Series LGTM, though I'm curious why you want the reply-to header,\r
+given that nothing I'm aware of consumes it.\r
+\r
+I second Jameson's opinion that we should push this first patch even\r
+if we wind up not pushing the others.\r
+\r
+Quoth Peter Wang on Jun 24 at  1:27 pm:\r
+> There didn't seem to be these basic tests for --format=text,\r
+> as there are for --format=json.  These are just the tests from\r
+> the `json' script, with adjusted expected outputs.\r
+> ---\r
+>  test/notmuch-test |    1 +\r
+>  test/text         |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+>  2 files changed, 56 insertions(+), 0 deletions(-)\r
+>  create mode 100755 test/text\r
+> \r
+> diff --git a/test/notmuch-test b/test/notmuch-test\r
+> index bfad5d3..ea39dfc 100755\r
+> --- a/test/notmuch-test\r
+> +++ b/test/notmuch-test\r
+> @@ -31,6 +31,7 @@ TESTS="\r
+>    excludes\r
+>    tagging\r
+>    json\r
+> +  text\r
+>    multipart\r
+>    thread-naming\r
+>    raw\r
+> diff --git a/test/text b/test/text\r
+> new file mode 100755\r
+> index 0000000..428c89b\r
+> --- /dev/null\r
+> +++ b/test/text\r
+> @@ -0,0 +1,55 @@\r
+> +#!/usr/bin/env bash\r
+> +test_description="--format=text output"\r
+> +. ./test-lib.sh\r
+> +\r
+> +test_begin_subtest "Show message: text"\r
+> +add_message "[subject]=\"text-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-show-message\""\r
+> +output=$(notmuch show --format=text "text-show-message" | notmuch_show_sanitize_all)\r
+> +test_expect_equal "$output" "\\r
+> +\f\r
+message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX\r
+> +\f\r
+header{\r
+> +Notmuch Test Suite <test_suite@notmuchmail.org> (2000-01-01) (inbox unread)\r
+> +Subject: text-show-subject\r
+> +From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+> +To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+> +Date: Sat, 01 Jan 2000 12:00:00 +0000\r
+> +\f\r
+header}\r
+> +\f\r
+body{\r
+> +\f\r
+part{ ID: 1, Content-type: text/plain\r
+> +text-show-message\r
+> +\f\r
+part}\r
+> +\f\r
+body}\r
+> +\f\r
+message}"\r
+> +\r
+> +test_begin_subtest "Search message: text"\r
+> +add_message "[subject]=\"text-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-search-message\""\r
+> +output=$(notmuch search --format=text "text-search-message" | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" \\r
+> +"thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; text-search-subject (inbox unread)"\r
+> +\r
+> +test_begin_subtest "Show message: text, utf-8"\r
+> +add_message "[subject]=\"text-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"tëxt-show-méssage\""\r
+> +output=$(notmuch show --format=text "tëxt-show-méssage" | notmuch_show_sanitize_all)\r
+> +test_expect_equal "$output" "\\r
+> +\f\r
+message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX\r
+> +\f\r
+header{\r
+> +Notmuch Test Suite <test_suite@notmuchmail.org> (2000-01-01) (inbox unread)\r
+> +Subject: text-show-utf8-body-sübjéct\r
+> +From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+> +To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+> +Date: Sat, 01 Jan 2000 12:00:00 +0000\r
+> +\f\r
+header}\r
+> +\f\r
+body{\r
+> +\f\r
+part{ ID: 1, Content-type: text/plain\r
+> +tëxt-show-méssage\r
+> +\f\r
+part}\r
+> +\f\r
+body}\r
+> +\f\r
+message}"\r
+> +\r
+> +test_begin_subtest "Search message: text, utf-8"\r
+> +add_message "[subject]=\"text-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"tëxt-search-méssage\""\r
+> +output=$(notmuch search --format=text "tëxt-search-méssage" | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" \\r
+> +"thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; text-search-utf8-body-sübjéct (inbox unread)"\r
+> +\r
+> +test_done\r