--- /dev/null
+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 0FB08431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 4 Dec 2012 11:25:03 -0800 (PST)\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 NrXC4SPhp556 for <notmuch@notmuchmail.org>;\r
+ Tue, 4 Dec 2012 11:24:59 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU\r
+ [18.7.68.36])\r
+ by olra.theworths.org (Postfix) with ESMTP id 2D350431FAE\r
+ for <notmuch@notmuchmail.org>; Tue, 4 Dec 2012 11:24:59 -0800 (PST)\r
+X-AuditID: 12074424-b7fe06d0000008f0-68-50be4e0983da\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+ by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id D7.E2.02288.90E4EB05; Tue, 4 Dec 2012 14:24:57 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id qB4JOvqS011845; \r
+ Tue, 4 Dec 2012 14:24:57 -0500\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 qB4JOtct010089\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+ Tue, 4 Dec 2012 14:24:56 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1Tfy6x-0001ow-2h; Tue, 04 Dec 2012 14:24:55 -0500\r
+From: Austin Clements <aclements@csail.mit.edu>\r
+To: Peter Feigl <craven@gmx.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2 4/5] Adding tests for --format=sexp.\r
+In-Reply-To: <1354632382-15609-5-git-send-email-craven@gmx.net>\r
+References: <1354632382-15609-1-git-send-email-craven@gmx.net>\r
+ <1354632382-15609-5-git-send-email-craven@gmx.net>\r
+User-Agent: Notmuch/0.14+100~gcb9b0b0 (http://notmuchmail.org) Emacs/23.4.1\r
+ (i486-pc-linux-gnu)\r
+Date: Tue, 04 Dec 2012 14:24:54 -0500\r
+Message-ID: <87a9tty60p.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFvrGIsWRmVeSWpSXmKPExsUixG6nosvpty/A4Mc0EYu9De2MFtdvzmR2\r
+ YPJYvGk/m8ezVbeYA5iiuGxSUnMyy1KL9O0SuDIOHt3PWjDZvOLC5FvsDYz9Bl2MnBwSAiYS\r
+ ez7vZYWwxSQu3FvP1sXIxSEksI9R4vbKTmYIZz2jxN9Zc9lAqoQELjBJzN8ZCGEvYZS43qIM\r
+ YrMJ6EusWDsJbJKIgKXE1C+XgOo5OIQFrCXuL4gBCXMK2EtcnHSOGaK1UGLivR4WkBJRgXiJ\r
+ y0sVQMIsAqoSk66sYQKxeYFu+3aigxnCFpQ4OfMJC4jNLKAu8WfeJWYIW1ti2cLXzBMYBWch\r
+ KZuFpGwWkrIFjMyrGGVTcqt0cxMzc4pTk3WLkxPz8lKLdM31cjNL9FJTSjcxgoPXRWUHY/Mh\r
+ pUOMAhyMSjy8Esb7AoRYE8uKK3MPMUpyMCmJ8v7zBArxJeWnVGYkFmfEF5XmpBYfYpTgYFYS\r
+ 4f1nB5TjTUmsrEotyodJSXOwKInzXk+56S8kkJ5YkpqdmlqQWgSTleHgUJLgne4D1ChYlJqe\r
+ WpGWmVOCkGbi4AQZzgM0fC5IDW9xQWJucWY6RP4Uo6KUOG8DSEIAJJFRmgfXC0surxjFgV4R\r
+ 5uUGqeIBJia47ldAg5mABr8Q2g0yuCQRISXVwLgo3a25StW3lZ+VqeYEb1tKZq1Y6QSLiseK\r
+ QdssnnfM5bJT6GuavO7c8uft67Pzm2xmuTbKXFR81MDIrFy0dOPaOW84I+a9Prbk6wwD9TiG\r
+ Jp4Lk9UDT7I+M3fr4r8TfERykaDKi4DV+3//Uu+f+k9zguii4BLb+982vFOqydScFd9svn/j\r
+ ciWW4oxEQy3mouJEAEdE04sJAwAA\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 19:25:03 -0000\r
+\r
+It would be nice to use something like test_expect_equal_json for this\r
+(probably based on Emacs' pp function), but this is fine for now.\r
+\r
+On Tue, 04 Dec 2012, Peter Feigl <craven@gmx.net> wrote:\r
+> Add basic tests, the same as for json, for the S-Expression output\r
+> format.\r
+> ---\r
+> test/notmuch-test | 1 +\r
+> test/sexp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\r
+> 2 files changed, 49 insertions(+)\r
+> create mode 100755 test/sexp\r
+>\r
+> diff --git a/test/notmuch-test b/test/notmuch-test\r
+> index a6ef34f..ca9c3dc 100755\r
+> --- a/test/notmuch-test\r
+> +++ b/test/notmuch-test\r
+> @@ -31,6 +31,7 @@ TESTS=3D"\r
+> excludes\r
+> tagging\r
+> json\r
+> + sexp\r
+> text\r
+> multipart\r
+> thread-naming\r
+> diff --git a/test/sexp b/test/sexp\r
+> new file mode 100755\r
+> index 0000000..fdc9de6\r
+> --- /dev/null\r
+> +++ b/test/sexp\r
+> @@ -0,0 +1,48 @@\r
+> +#!/usr/bin/env bash\r
+> +test_description=3D"--format=3Dsexp output"\r
+> +. ./test-lib.sh\r
+> +\r
+> +test_begin_subtest "Show message: sexp"\r
+> +add_message "[subject]=3D\"sexp-show-subject\"" "[date]=3D\"Sat, 01 Jan =\r
+2000 12:00:00 -0000\"" "[bcc]=3D\"test_suite+bcc@notmuchmail.org\"" "[reply=\r
+-to]=3D\"test_suite+replyto@notmuchmail.org\"" "[body]=3D\"sexp-show-messag=\r
+e\""\r
+> +output=3D$(notmuch show --format=3Dsexp "sexp-show-message")\r
+> +test_expect_equal "$output" "(((((id \"msg-001@notmuch-test-suite\") (ma=\r
+tch t) (excluded nil) (filename \"/home/nex/notmuch-sexp/test/tmp.sexp/mail=\r
+/msg-001\") (timestamp 946728000) (date_relative \"2000-01-01\") (tags (\"i=\r
+nbox\" \"unread\")) (headers ((Subject \"sexp-show-subject\") (From \"Notmu=\r
+ch Test Suite <test_suite@notmuchmail.org>\") (To \"Notmuch Test Suite <tes=\r
+t_suite@notmuchmail.org>\") (Bcc \"test_suite+bcc@notmuchmail.org\") (Reply=\r
+-To \"test_suite+replyto@notmuchmail.org\") (Date \"Sat, 01 Jan 2000 12:00:=\r
+00 +0000\"))) (body (((id 1) (content-type \"text/plain\") (content \"sexp-=\r
+show-message\n\"))))) ())))"\r
+> +\r
+> +# This should be the same output as above.\r
+> +test_begin_subtest "Show message: sexp --body=3Dtrue"\r
+> +output=3D$(notmuch show --format=3Dsexp --body=3Dtrue "sexp-show-message=\r
+")\r
+> +test_expect_equal "$output" "(((((id \"msg-001@notmuch-test-suite\") (ma=\r
+tch t) (excluded nil) (filename \"/home/nex/notmuch-sexp/test/tmp.sexp/mail=\r
+/msg-001\") (timestamp 946728000) (date_relative \"2000-01-01\") (tags (\"i=\r
+nbox\" \"unread\")) (headers ((Subject \"sexp-show-subject\") (From \"Notmu=\r
+ch Test Suite <test_suite@notmuchmail.org>\") (To \"Notmuch Test Suite <tes=\r
+t_suite@notmuchmail.org>\") (Bcc \"test_suite+bcc@notmuchmail.org\") (Reply=\r
+-To \"test_suite+replyto@notmuchmail.org\") (Date \"Sat, 01 Jan 2000 12:00:=\r
+00 +0000\"))) (body (((id 1) (content-type \"text/plain\") (content \"sexp-=\r
+show-message\n\"))))) ())))"\r
+> +\r
+> +test_begin_subtest "Show message: sexp --body=3Dfalse"\r
+> +output=3D$(notmuch show --format=3Dsexp --body=3Dfalse "sexp-show-messag=\r
+e")\r
+> +test_expect_equal "$output" "(((((id \"msg-001@notmuch-test-suite\") (ma=\r
+tch t) (excluded nil) (filename \"/home/nex/notmuch-sexp/test/tmp.sexp/mail=\r
+/msg-001\") (timestamp 946728000) (date_relative \"2000-01-01\") (tags (\"i=\r
+nbox\" \"unread\")) (headers ((Subject \"sexp-show-subject\") (From \"Notmu=\r
+ch Test Suite <test_suite@notmuchmail.org>\") (To \"Notmuch Test Suite <tes=\r
+t_suite@notmuchmail.org>\") (Bcc \"test_suite+bcc@notmuchmail.org\") (Reply=\r
+-To \"test_suite+replyto@notmuchmail.org\") (Date \"Sat, 01 Jan 2000 12:00:=\r
+00 +0000\")))) ())))"\r
+> +\r
+> +test_begin_subtest "Search message: sexp"\r
+> +add_message "[subject]=3D\"sexp-search-subject\"" "[date]=3D\"Sat, 01 Ja=\r
+n 2000 12:00:00 -0000\"" "[body]=3D\"sexp-search-message\""\r
+> +output=3D$(notmuch search --format=3Dsexp "sexp-search-message" | notmuc=\r
+h_search_sanitize)\r
+> +test_expect_equal "$output" "(((thread \"0000000000000002\") (timestamp =\r
+946728000) (date_relative \"2000-01-01\") (matched 1) (total 1) (authors \"=\r
+Notmuch Test Suite\") (subject \"sexp-search-subject\") (tags (\"inbox\" \"=\r
+unread\"))))"\r
+> +\r
+> +test_begin_subtest "Show message: sexp, utf-8"\r
+> +add_message "[subject]=3D\"sexp-show-utf8-body-s=C3=BCbj=C3=A9ct\"" "[da=\r
+te]=3D\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=3D\"js=C3=B6n-show-m=C3=\r
+=A9ssage\""\r
+> +output=3D$(notmuch show --format=3Dsexp "js=C3=B6n-show-m=C3=A9ssage")\r
+> +test_expect_equal "$output" "(((((id \"msg-003@notmuch-test-suite\") (ma=\r
+tch t) (excluded nil) (filename \"/home/nex/notmuch-sexp/test/tmp.sexp/mail=\r
+/msg-003\") (timestamp 946728000) (date_relative \"2000-01-01\") (tags (\"i=\r
+nbox\" \"unread\")) (headers ((Subject \"sexp-show-utf8-body-s=C3=BCbj=C3=\r
+=A9ct\") (From \"Notmuch Test Suite <test_suite@notmuchmail.org>\") (To \"N=\r
+otmuch Test Suite <test_suite@notmuchmail.org>\") (Date \"Sat, 01 Jan 2000 =\r
+12:00:00 +0000\"))) (body (((id 1) (content-type \"text/plain\") (content \=\r
+"js=C3=B6n-show-m=C3=A9ssage\n\"))))) ())))"\r
+> +\r
+> +test_begin_subtest "Show message: sexp, inline attachment filename"\r
+> +subject=3D'sexp-show-inline-attachment-filename'\r
+> +id=3D"sexp-show-inline-attachment-filename@notmuchmail.org"\r
+> +emacs_deliver_message \\r
+> + "$subject" \\r
+> + 'This is a test message with inline attachment with a filename' \\r
+> + "(mml-attach-file \"$TEST_DIRECTORY/README\" nil nil \"inline\")\r
+> + (message-goto-eoh)\r
+> + (insert \"Message-ID: <$id>\n\")"\r
+> +output=3D$(notmuch show --format=3Dsexp "id:$id")\r
+> +filename=3D$(notmuch search --output=3Dfiles "id:$id")\r
+> +test_expect_equal "$output" "(((((id \"sexp-show-inline-attachment-filen=\r
+ame@notmuchmail.org\") (match t) (excluded nil) (filename \"$filename\") (t=\r
+imestamp 946728000) (date_relative \"2000-01-01\") (tags (\"inbox\")) (head=\r
+ers ((Subject \"sexp-show-inline-attachment-filename\") (From \"Notmuch Tes=\r
+t Suite <test_suite@notmuchmail.org>\") (To \"test_suite@notmuchmail.org\")=\r
+ (Date \"Sat, 01 Jan 2000 12:00:00 +0000\"))) (body (((id 1) (content-type =\r
+\"multipart/mixed\") (content (((id 2) (content-type \"text/plain\") (conte=\r
+nt \"This is a test message with inline attachment with a filename\")) ((id=\r
+ 3) (content-type \"application/octet-stream\") (filename \"README\")))))))=\r
+) ())))"\r
+> +\r
+> +test_begin_subtest "Search message: sexp, utf-8"\r
+> +add_message "[subject]=3D\"sexp-search-utf8-body-s=C3=BCbj=C3=A9ct\"" "[=\r
+date]=3D\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=3D\"js=C3=B6n-search-m=\r
+=C3=A9ssage\""\r
+> +output=3D$(notmuch search --format=3Dsexp "js=C3=B6n-search-m=C3=A9ssage=\r
+" | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "(((thread \"0000000000000005\") (timestamp =\r
+946728000) (date_relative \"2000-01-01\") (matched 1) (total 1) (authors \"=\r
+Notmuch Test Suite\") (subject \"sexp-search-utf8-body-s=C3=BCbj=C3=A9ct\")=\r
+ (tags (\"inbox\" \"unread\"))))"\r
+> +\r
+> +\r
+> +test_done\r
+> --=20\r
+> 1.8.0\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r