Re: notmuch-emacs should correctly handle signature status on reply
[notmuch-archives.git] / 77 / 6e5c38cca619340f24769a0b42504682910917
1 Return-Path: <nex@nexoid.at>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id B0BEE431FD4\r
6         for <notmuch@notmuchmail.org>; Thu,  6 Dec 2012 03:45:28 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: 0.001\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=0.001 tagged_above=-999 required=5\r
13         tests=[FREEMAIL_FROM=0.001] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id j4s9hC8MXK58 for <notmuch@notmuchmail.org>;\r
17         Thu,  6 Dec 2012 03:45:26 -0800 (PST)\r
18 Received: from mail.nexoid.at (www.nexoid.at [178.79.130.240])\r
19         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id ADD26431FC3\r
22         for <notmuch@notmuchmail.org>; Thu,  6 Dec 2012 03:45:21 -0800 (PST)\r
23 Received: by mail.nexoid.at (Postfix, from userid 1000)\r
24         id 4FCB411C110; Thu,  6 Dec 2012 12:45:14 +0100 (CET)\r
25 From: Peter Feigl <craven@gmx.net>\r
26 To: notmuch@notmuchmail.org\r
27 Subject: [PATCH v4 4/5] Adding tests for --format=sexp.\r
28 Date: Thu,  6 Dec 2012 12:44:58 +0100\r
29 Message-Id:\r
30  <2e05638af4ddc1f93f8b4fc5dde7c5d2fde8cda6.1354794428.git.craven@gmx.net>\r
31 X-Mailer: git-send-email 1.8.0\r
32 In-Reply-To: <cover.1354794428.git.craven@gmx.net>\r
33 References: <cover.1354794428.git.craven@gmx.net>\r
34 In-Reply-To: <cover.1354794428.git.craven@gmx.net>\r
35 References: <cover.1354794428.git.craven@gmx.net>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain; charset=UTF-8\r
38 Content-Transfer-Encoding: 8bit\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Thu, 06 Dec 2012 11:45:29 -0000\r
52 \r
53 Add basic tests, the same as for json, for the S-Expression output\r
54 format.\r
55 ---\r
56  test/notmuch-test |  1 +\r
57  test/sexp         | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\r
58  2 files changed, 49 insertions(+)\r
59  create mode 100755 test/sexp\r
60 \r
61 diff --git a/test/notmuch-test b/test/notmuch-test\r
62 index a6ef34f..ca9c3dc 100755\r
63 --- a/test/notmuch-test\r
64 +++ b/test/notmuch-test\r
65 @@ -31,6 +31,7 @@ TESTS="\r
66    excludes\r
67    tagging\r
68    json\r
69 +  sexp\r
70    text\r
71    multipart\r
72    thread-naming\r
73 diff --git a/test/sexp b/test/sexp\r
74 new file mode 100755\r
75 index 0000000..b804942\r
76 --- /dev/null\r
77 +++ b/test/sexp\r
78 @@ -0,0 +1,48 @@\r
79 +#!/usr/bin/env bash\r
80 +test_description="--format=sexp output"\r
81 +. ./test-lib.sh\r
82 +\r
83 +test_begin_subtest "Show message: sexp"\r
84 +add_message "[subject]=\"sexp-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc@notmuchmail.org\"" "[reply-to]=\"test_suite+replyto@notmuchmail.org\"" "[body]=\"sexp-show-message\""\r
85 +output=$(notmuch show --format=sexp "sexp-show-message")\r
86 +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :filename \"${gen_msg_filename}\" :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show-subject\" :From \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :To \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :Bcc \"test_suite+bcc@notmuchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/plain\" :content \"sexp-show-message\n\"))) ())))"\r
87 +\r
88 +# This should be the same output as above.\r
89 +test_begin_subtest "Show message: sexp --body=true"\r
90 +output=$(notmuch show --format=sexp --body=true "sexp-show-message")\r
91 +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :filename \"${gen_msg_filename}\" :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show-subject\" :From \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :To \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :Bcc \"test_suite+bcc@notmuchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/plain\" :content \"sexp-show-message\n\"))) ())))"\r
92 +\r
93 +test_begin_subtest "Show message: sexp --body=false"\r
94 +output=$(notmuch show --format=sexp --body=false "sexp-show-message")\r
95 +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :filename \"${gen_msg_filename}\" :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show-subject\" :From \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :To \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :Bcc \"test_suite+bcc@notmuchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\")) ())))"\r
96 +\r
97 +test_begin_subtest "Search message: sexp"\r
98 +add_message "[subject]=\"sexp-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"sexp-search-message\""\r
99 +output=$(notmuch search --format=sexp "sexp-search-message" | notmuch_search_sanitize)\r
100 +test_expect_equal "$output" "((:thread \"0000000000000002\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :subject \"sexp-search-subject\" :tags (\"inbox\" \"unread\")))"\r
101 +\r
102 +test_begin_subtest "Show message: sexp, utf-8"\r
103 +add_message "[subject]=\"sexp-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-show-méssage\""\r
104 +output=$(notmuch show --format=sexp "jsön-show-méssage")\r
105 +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :filename \"${gen_msg_filename}\" :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-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
106 +\r
107 +test_begin_subtest "Show message: sexp, inline attachment filename"\r
108 +subject='sexp-show-inline-attachment-filename'\r
109 +id="sexp-show-inline-attachment-filename@notmuchmail.org"\r
110 +emacs_deliver_message \\r
111 +    "$subject" \\r
112 +    'This is a test message with inline attachment with a filename' \\r
113 +    "(mml-attach-file \"$TEST_DIRECTORY/README\" nil nil \"inline\")\r
114 +     (message-goto-eoh)\r
115 +     (insert \"Message-ID: <$id>\n\")"\r
116 +output=$(notmuch show --format=sexp "id:$id")\r
117 +filename=$(notmuch search --output=files "id:$id")\r
118 +test_expect_equal "$output" "((((:id \"$id\" :match t :excluded nil :filename \"$filename\" :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\") :headers (:Subject \"sexp-show-inline-attachment-filename\" :From \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :To \"test_suite@notmuchmail.org\" :Date \"Sat, 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\"))))) ())))"\r
119 +\r
120 +test_begin_subtest "Search message: sexp, utf-8"\r
121 +add_message "[subject]=\"sexp-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-search-méssage\""\r
122 +output=$(notmuch search --format=sexp "jsön-search-méssage" | notmuch_search_sanitize)\r
123 +test_expect_equal "$output" "((:thread \"0000000000000005\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :subject \"sexp-search-utf8-body-sübjéct\" :tags (\"inbox\" \"unread\")))"\r
124 +\r
125 +\r
126 +test_done\r
127 -- \r
128 1.8.0\r
129 \r