notmuch and "mute" -- useful to anyone?
[notmuch-archives.git] / 06 / 9a015ba0072f0792dc24514ee4fc485d9d05c0
1 Return-Path: <ethan.glasser.camp@gmail.com>\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 DC5CE431FB6\r
6         for <notmuch@notmuchmail.org>; Mon, 25 Jun 2012 13:52:55 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 1.061\r
10 X-Spam-Level: *\r
11 X-Spam-Status: No, score=1.061 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_BL_SPAMCOP_NET=1.246,\r
14         RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_SORBS_WEB=0.614] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id pay1ur-mReCD for <notmuch@notmuchmail.org>;\r
18         Mon, 25 Jun 2012 13:52:54 -0700 (PDT)\r
19 Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com\r
20         [209.85.212.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 352F0431FAF\r
23         for <notmuch@notmuchmail.org>; Mon, 25 Jun 2012 13:52:54 -0700 (PDT)\r
24 Received: by wibhm6 with SMTP id hm6so2196032wib.2\r
25         for <notmuch@notmuchmail.org>; Mon, 25 Jun 2012 13:52:51 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\r
28         :mime-version:content-type:content-transfer-encoding;\r
29         bh=Mhw/LYIt+bgFVRXJQ4iuJnciJWZ9Oc/emnbTCdY9KXU=;\r
30         b=gcqO5KMGFNQ8AtWUrjkiSSbSYYHyjgWsixPHm2jqxy49LEw247/QauAKPrNtEiFLQS\r
31         xK4ktraR3lXZkaCztKJ+8dMZkQ7FjAqwLvACzX0Tx4AW6WZniFYr488YtkZ7S1C9TTEF\r
32         aGyVCLPZMpwyO/iq8rCs64BulYgEw2d5NFFuiM9lG1ulWZkf9yU/ai9GImX5mLHtZkco\r
33         8GnTGy5khcNC14+yapVpkvizK5QjtqauzGDcwyFBqWVZrBGQd2/ocoYGk1aF3Ae8gT9X\r
34         /q1FgdabILyCB6FRzzyVGQoiVoydTtETAnF1s28puSd/g+GzwQ1JHNFdXatTCVeQi47G\r
35         imYQ==\r
36 Received: by 10.180.14.165 with SMTP id q5mr27186173wic.8.1340657571500;\r
37         Mon, 25 Jun 2012 13:52:51 -0700 (PDT)\r
38 Received: from localhost ([195.24.209.21])\r
39         by mx.google.com with ESMTPS id eu4sm38226wib.2.2012.06.25.13.52.46\r
40         (version=TLSv1/SSLv3 cipher=OTHER);\r
41         Mon, 25 Jun 2012 13:52:50 -0700 (PDT)\r
42 From: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [RFC PATCH 07/14] Update tests that need to see filenames to use URIs\r
45 Date: Mon, 25 Jun 2012 16:51:50 -0400\r
46 Message-Id: <1340657517-6539-3-git-send-email-ethan@betacantrips.com>\r
47 X-Mailer: git-send-email 1.7.9.5\r
48 In-Reply-To: <1340657517-6539-1-git-send-email-ethan@betacantrips.com>\r
49 References: <1340657517-6539-1-git-send-email-ethan@betacantrips.com>\r
50 MIME-Version: 1.0\r
51 Content-Type: text/plain; charset=UTF-8\r
52 Content-Transfer-Encoding: 8bit\r
53 X-Mailman-Approved-At: Tue, 26 Jun 2012 03:51:54 -0700\r
54 X-BeenThere: notmuch@notmuchmail.org\r
55 X-Mailman-Version: 2.1.13\r
56 Precedence: list\r
57 List-Id: "Use and development of the notmuch mail system."\r
58         <notmuch.notmuchmail.org>\r
59 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
61 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
62 List-Post: <mailto:notmuch@notmuchmail.org>\r
63 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
64 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
66 X-List-Received-Date: Mon, 25 Jun 2012 20:52:56 -0000\r
67 \r
68 This fixes all tests except atomicity, which should be next.\r
69 \r
70 Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>\r
71 ---\r
72  test/emacs                   |    2 +-\r
73  test/json                    |    4 ++--\r
74  test/maildir-sync            |    7 ++++---\r
75  test/multipart               |    4 ++--\r
76  test/new                     |    6 +++---\r
77  test/search-folder-coherence |    2 +-\r
78  test/search-output           |    4 ++--\r
79  test/test-lib.sh             |    3 +++\r
80  8 files changed, 18 insertions(+), 14 deletions(-)\r
81 \r
82 diff --git a/test/emacs b/test/emacs\r
83 index e9f954c..c08791e 100755\r
84 --- a/test/emacs\r
85 +++ b/test/emacs\r
86 @@ -621,7 +621,7 @@ Stash my stashables\r
87  id:"bought"\r
88  bought\r
89  inbox,stashtest\r
90 -${gen_msg_filename}\r
91 +${gen_msg_uri}\r
92  http://mid.gmane.org/bought\r
93  http://marc.info/?i=bought\r
94  http://mail-archive.com/search?l=mid&q=bought\r
95 diff --git a/test/json b/test/json\r
96 index 6439788..be29fac 100755\r
97 --- a/test/json\r
98 +++ b/test/json\r
99 @@ -5,7 +5,7 @@ test_description="--format=json output"\r
100  test_begin_subtest "Show message: json"\r
101  add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-show-message\""\r
102  output=$(notmuch show --format=json "json-show-message")\r
103 -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
104 +test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_uri}\", \"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
105  \r
106  test_begin_subtest "Search message: json"\r
107  add_message "[subject]=\"json-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-search-message\""\r
108 @@ -22,7 +22,7 @@ test_expect_equal "$output" "[{\"thread\": \"XXX\",\r
109  test_begin_subtest "Show message: json, utf-8"\r
110  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
111  output=$(notmuch show --format=json "jsön-show-méssage")\r
112 -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-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
113 +test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_uri}\", \"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
114  \r
115  test_begin_subtest "Show message: json, inline attachment filename"\r
116  subject='json-show-inline-attachment-filename'\r
117 diff --git a/test/maildir-sync b/test/maildir-sync\r
118 index 01348d3..a2e110e 100755\r
119 --- a/test/maildir-sync\r
120 +++ b/test/maildir-sync\r
121 @@ -8,7 +8,7 @@ test_description="maildir synchronization"\r
122  # --format=json" output includes some newlines. Also, need to avoid\r
123  # including the local value of MAIL_DIR in the result.\r
124  filter_show_json() {\r
125 -    sed -e 's/, /,\n/g'  | sed -e "s|${MAIL_DIR}/|MAIL_DIR/|"\r
126 +    sed -e 's/, /,\n/g'  | sed -e "s|${MAIL_URI}/|MAIL_DIR/|"\r
127      echo\r
128  }\r
129  \r
130 @@ -102,8 +102,9 @@ No new mail. Detected 1 file rename.\r
131  thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Removing S flag (inbox unread)"\r
132  \r
133  test_begin_subtest "Removing info from filename leaves tags unchanged"\r
134 -add_message [subject]='"Message to lose maildir info"' [filename]='message-to-lose-maildir-info' [dir]=cur\r
135 -notmuch tag -unread subject:"Message to lose maildir info"\r
136 +generate_message [subject]='"Message to lose maildir info"' [filename]='message-to-lose-maildir-info' [dir]=cur\r
137 +notmuch new > hrngh.new\r
138 +notmuch tag -unread subject:"Message to lose maildir info" > hrngh.tag\r
139  mv "$MAIL_DIR/cur/message-to-lose-maildir-info:2,S" "$MAIL_DIR/cur/message-without-maildir-info"\r
140  output=$(NOTMUCH_NEW)\r
141  output+="\r
142 diff --git a/test/multipart b/test/multipart\r
143 index 72d3927..ccf410b 100755\r
144 --- a/test/multipart\r
145 +++ b/test/multipart\r
146 @@ -109,7 +109,7 @@ notmuch new > /dev/null\r
147  test_begin_subtest "--format=text --part=0, full message"\r
148  notmuch show --format=text --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
149  cat <<EOF >EXPECTED\r
150 -\f\r
151 message{ id:87liy5ap00.fsf@yoom.home.cworth.org depth:0 match:1 excluded:0 filename:${MAIL_DIR}/multipart\r
152 +\f\r
153 message{ id:87liy5ap00.fsf@yoom.home.cworth.org depth:0 match:1 excluded:0 filename:${MAIL_URI}/multipart\r
154  \f\r
155 header{\r
156  Carl Worth <cworth@cworth.org> (2001-01-05) (attachment inbox signed unread)\r
157  Subject: Multipart message\r
158 @@ -323,7 +323,7 @@ notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' | s\r
159  echo >>OUTPUT # expect *no* newline at end of output\r
160  cat <<EOF >EXPECTED\r
161  \r
162 -{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "excluded": false, "filename": "${MAIL_DIR}/multipart", "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [\r
163 +{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "excluded": false, "filename": "${MAIL_URI}/multipart", "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [\r
164  {"id": 1, "content-type": "multipart/signed", "content": [\r
165  {"id": 2, "content-type": "multipart/mixed", "content": [\r
166  {"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
167 diff --git a/test/new b/test/new\r
168 index cab7c01..e7852ec 100755\r
169 --- a/test/new\r
170 +++ b/test/new\r
171 @@ -171,9 +171,9 @@ touch "${MAIL_DIR}"/ignored_file\r
172  touch "${MAIL_DIR}"/.ignored_hidden_file\r
173  output=$(NOTMUCH_NEW 2>&1)\r
174  test_expect_equal "$output" \\r
175 -"Note: Ignoring non-mail file: ${MAIL_DIR}/.git/config\r
176 -Note: Ignoring non-mail file: ${MAIL_DIR}/.ignored_hidden_file\r
177 -Note: Ignoring non-mail file: ${MAIL_DIR}/ignored_file\r
178 +"Note: Ignoring non-mail file: ${MAIL_URI}/.git/config\r
179 +Note: Ignoring non-mail file: ${MAIL_URI}/.ignored_hidden_file\r
180 +Note: Ignoring non-mail file: ${MAIL_URI}/ignored_file\r
181  Added 1 new message to the database."\r
182  \r
183  test_begin_subtest "Ignore files and directories specified in new.ignore"\r
184 diff --git a/test/search-folder-coherence b/test/search-folder-coherence\r
185 index 3f6ec76..08558db 100755\r
186 --- a/test/search-folder-coherence\r
187 +++ b/test/search-folder-coherence\r
188 @@ -27,7 +27,7 @@ cat <<EOF >EXPECTED\r
189  MAIL_DIR/msg-001\r
190  MAIL_DIR/spam/msg-001\r
191  EOF\r
192 -notmuch search --output=files id:$id_x | sed -e "s,$MAIL_DIR,MAIL_DIR," >OUTPUT\r
193 +notmuch search --output=files id:$id_x | sed -e "s,$MAIL_URI,MAIL_DIR," >OUTPUT\r
194  test_expect_equal_file OUTPUT EXPECTED\r
195  \r
196  test_begin_subtest "Test matches folder:spam"\r
197 diff --git a/test/search-output b/test/search-output\r
198 index 8b57a43..d038dc7 100755\r
199 --- a/test/search-output\r
200 +++ b/test/search-output\r
201 @@ -181,7 +181,7 @@ EOF\r
202  test_expect_equal_file OUTPUT EXPECTED\r
203  \r
204  test_begin_subtest "--output=files"\r
205 -notmuch search --output=files '*' | sed -e "s,$MAIL_DIR,MAIL_DIR," >OUTPUT\r
206 +notmuch search --output=files '*' | sed -e "s,$MAIL_URI,MAIL_DIR," >OUTPUT\r
207  cat <<EOF >EXPECTED\r
208  MAIL_DIR/cur/52:2,\r
209  MAIL_DIR/cur/53:2,\r
210 @@ -240,7 +240,7 @@ EOF\r
211  test_expect_equal_file OUTPUT EXPECTED\r
212  \r
213  test_begin_subtest "--output=files --format=json"\r
214 -notmuch search --format=json --output=files '*' | sed -e "s,$MAIL_DIR,MAIL_DIR," >OUTPUT\r
215 +notmuch search --format=json --output=files '*' | sed -e "s,$MAIL_URI,MAIL_DIR," >OUTPUT\r
216  cat <<EOF >EXPECTED\r
217  ["MAIL_DIR/cur/52:2,",\r
218  "MAIL_DIR/cur/53:2,",\r
219 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
220 index 06aaea2..195158c 100644\r
221 --- a/test/test-lib.sh\r
222 +++ b/test/test-lib.sh\r
223 @@ -287,6 +287,7 @@ generate_message ()\r
224  \r
225      gen_msg_cnt=$((gen_msg_cnt + 1))\r
226      if [ -z "${template[filename]}" ]; then\r
227 +\r
228         gen_msg_name="msg-$(printf "%03d" $gen_msg_cnt)"\r
229      else\r
230         gen_msg_name=${template[filename]}\r
231 @@ -304,6 +305,7 @@ generate_message ()\r
232         gen_msg_filename="${MAIL_DIR}/${template[dir]}/$gen_msg_name"\r
233         mkdir -p "$(dirname "$gen_msg_filename")"\r
234      fi\r
235 +    gen_msg_uri=maildir://$gen_msg_filename\r
236  \r
237      if [ -z "${template[body]}" ]; then\r
238         template[body]="This is just a test message (#${gen_msg_cnt})"\r
239 @@ -1149,6 +1151,7 @@ export HOME="${TMP_DIRECTORY}/home"\r
240  mkdir -p "${HOME}"\r
241  \r
242  MAIL_DIR="${TMP_DIRECTORY}/mail"\r
243 +MAIL_URI=maildir://$MAIL_DIR\r
244  export GNUPGHOME="${TMP_DIRECTORY}/gnupg"\r
245  export NOTMUCH_CONFIG="${TMP_DIRECTORY}/notmuch-config"\r
246  \r
247 -- \r
248 1.7.9.5\r
249 \r