[PATCH v2 0/2] Always insert crypto buttons.
[notmuch-archives.git] / 24 / 28e82eec58e6587d206323b1e25fe4796ff2a6
1 Return-Path: <dmitry.kurochkin@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 8B26E431FAF\r
6         for <notmuch@notmuchmail.org>; Wed,  1 Feb 2012 16:05:36 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 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_DNSWL_LOW=-0.7] 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 Fv2aFVDq+UYw for <notmuch@notmuchmail.org>;\r
17         Wed,  1 Feb 2012 16:05:35 -0800 (PST)\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id E2937431FAE\r
22         for <notmuch@notmuchmail.org>; Wed,  1 Feb 2012 16:05:34 -0800 (PST)\r
23 Received: by mail-bk0-f53.google.com with SMTP id 11so1737569bke.26\r
24         for <notmuch@notmuchmail.org>; Wed, 01 Feb 2012 16:05:34 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
27         bh=vAMIyUQKhwcWoisgfuf+tZP/+34DTu4LLfQJJYW7kDs=;\r
28         b=gYblaVD3kLsxSPL+uxmTKj8qVCAWF48p0SEuUFsNeNgWjEe6SLDEXYfXcxJeNXG1EQ\r
29         YWQJUkRct70Q4GbM2/PxtMHOTYe0BlNpit/nF71o2Mu7zazAk4Rerkr5opvYAeii372e\r
30         4sTrhW329ZiTeMCkH6HyrX3NpiogK1nRkxEfU=\r
31 Received: by 10.204.133.219 with SMTP id g27mr310284bkt.47.1328141130624;\r
32         Wed, 01 Feb 2012 16:05:30 -0800 (PST)\r
33 Received: from localhost ([91.144.186.21])\r
34         by mx.google.com with ESMTPS id ga13sm1587085bkc.5.2012.02.01.16.05.29\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Wed, 01 Feb 2012 16:05:30 -0800 (PST)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH 2/2] test: fix order and format of test_expect_equal_file\r
40         arguments\r
41 Date: Thu,  2 Feb 2012 04:04:10 +0400\r
42 Message-Id: <1328141050-30356-3-git-send-email-dmitry.kurochkin@gmail.com>\r
43 X-Mailer: git-send-email 1.7.9\r
44 In-Reply-To: <1328141050-30356-1-git-send-email-dmitry.kurochkin@gmail.com>\r
45 References: <1328141050-30356-1-git-send-email-dmitry.kurochkin@gmail.com>\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Thu, 02 Feb 2012 00:05:36 -0000\r
59 \r
60 The patch fixes tests which were broken by the new\r
61 test_expect_equal_file() argument check.  Some tests have correct\r
62 filename format, but wrong argument order.  Others require files to be\r
63 renamed.\r
64 ---\r
65  test/crypto          |   10 +++++-----\r
66  test/dump-restore    |   10 +++++-----\r
67  test/hooks           |    8 ++++----\r
68  test/multipart       |   20 ++++++++++----------\r
69  test/search-limiting |   22 +++++++++++-----------\r
70  test/symbol-hiding   |    4 ++--\r
71  6 files changed, 37 insertions(+), 37 deletions(-)\r
72 \r
73 diff --git a/test/crypto b/test/crypto\r
74 index 446a58b..9fdf710 100755\r
75 --- a/test/crypto\r
76 +++ b/test/crypto\r
77 @@ -140,14 +140,14 @@ test_expect_equal \\r
78  mv "${GNUPGHOME}"{.bak,}\r
79  \r
80  # create a test encrypted message with attachment\r
81 -cat <<EOF >TESTATTACHMENT\r
82 +cat <<EOF >TESTATTACHMENT.expected\r
83  This is a test file.\r
84  EOF\r
85  test_expect_success 'emacs delivery of encrypted message with attachment' \\r
86  'emacs_deliver_message \\r
87      "test encrypted message 001" \\r
88      "This is a test encrypted message.\n" \\r
89 -    "(mml-attach-file \"TESTATTACHMENT\") (mml-secure-message-encrypt)"'\r
90 +    "(mml-attach-file \"TESTATTACHMENT.expected\") (mml-secure-message-encrypt)"'\r
91  \r
92  test_begin_subtest "decryption, --format=text"\r
93  output=$(notmuch show --format=text --decrypt subject:"test encrypted message 001" \\r
94 @@ -170,7 +170,7 @@ Non-text part: application/pgp-encrypted\r
95  \f\r
96 part{ ID: 4, Content-type: text/plain\r
97  This is a test encrypted message.\r
98  \f\r
99 part}\r
100 -\f\r
101 attachment{ ID: 5, Filename: TESTATTACHMENT, Content-type: application/octet-stream\r
102 +\f\r
103 attachment{ ID: 5, Filename: TESTATTACHMENT.expected, Content-type: application/octet-stream\r
104  Non-text part: application/octet-stream\r
105  \f\r
106 attachment}\r
107  \f\r
108 part}\r
109 @@ -210,7 +210,7 @@ expected='[[[{"id": "XXXXX",\r
110   "content": "This is a test encrypted message.\n"},\r
111   {"id": 5,\r
112   "content-type": "application/octet-stream",\r
113 - "filename": "TESTATTACHMENT"}]}]}]},\r
114 + "filename": "TESTATTACHMENT.expected"}]}]}]},\r
115   []]]]'\r
116  test_expect_equal \\r
117      "$output" \\r
118 @@ -233,7 +233,7 @@ notmuch show \\r
119      --part=5 \\r
120      --decrypt \\r
121      subject:"test encrypted message 001" >OUTPUT\r
122 -test_expect_equal_file OUTPUT TESTATTACHMENT\r
123 +test_expect_equal_file OUTPUT TESTATTACHMENT.expected\r
124  \r
125  test_begin_subtest "decryption failure with missing key"\r
126  mv "${GNUPGHOME}"{,.bak}\r
127 diff --git a/test/dump-restore b/test/dump-restore\r
128 index 439e998..a6cfce2 100755\r
129 --- a/test/dump-restore\r
130 +++ b/test/dump-restore\r
131 @@ -55,7 +55,7 @@ test_expect_success 'Invalid restore invocation' \\r
132  \r
133  test_begin_subtest "dump outfile"\r
134  notmuch dump dump-outfile.actual\r
135 -test_expect_equal_file dump.expected dump-outfile.actual\r
136 +test_expect_equal_file dump-outfile.actual dump.expected\r
137  \r
138  test_begin_subtest "dump outfile # deprecated"\r
139  test_expect_equal "Warning: the output file argument of dump is deprecated."\\r
140 @@ -63,7 +63,7 @@ test_expect_equal "Warning: the output file argument of dump is deprecated."\\r
141  \r
142  test_begin_subtest "dump outfile --"\r
143  notmuch dump dump-1-arg-dash.actual --\r
144 -test_expect_equal_file dump.expected dump-1-arg-dash.actual\r
145 +test_expect_equal_file dump-1-arg-dash.actual dump.expected\r
146  \r
147  # Note, we assume all messages from cworth have a message-id\r
148  # containing cworth.org\r
149 @@ -72,14 +72,14 @@ grep 'cworth[.]org' dump.expected > dump-cworth.expected\r
150  \r
151  test_begin_subtest "dump -- from:cworth"\r
152  notmuch dump -- from:cworth > dump-dash-cworth.actual\r
153 -test_expect_equal_file dump-cworth.expected dump-dash-cworth.actual\r
154 +test_expect_equal_file dump-dash-cworth.actual dump-cworth.expected\r
155  \r
156  test_begin_subtest "dump outfile from:cworth"\r
157  notmuch dump dump-outfile-cworth.actual from:cworth\r
158 -test_expect_equal_file dump-cworth.expected dump-outfile-cworth.actual\r
159 +test_expect_equal_file dump-outfile-cworth.actual dump-cworth.expected\r
160  \r
161  test_begin_subtest "dump outfile -- from:cworth"\r
162  notmuch dump dump-outfile-dash-inbox.actual -- from:cworth\r
163 -test_expect_equal_file dump-cworth.expected dump-outfile-dash-inbox.actual\r
164 +test_expect_equal_file dump-outfile-dash-inbox.actual dump-cworth.expected\r
165  \r
166  test_done\r
167 diff --git a/test/hooks b/test/hooks\r
168 index 77e8569..d084d1f 100755\r
169 --- a/test/hooks\r
170 +++ b/test/hooks\r
171 @@ -36,14 +36,14 @@ rm_hooks\r
172  generate_message\r
173  create_echo_hook "pre-new" expected output\r
174  notmuch new > /dev/null\r
175 -test_expect_equal_file expected output\r
176 +test_expect_equal_file output expected\r
177  \r
178  test_begin_subtest "post-new is run"\r
179  rm_hooks\r
180  generate_message\r
181  create_echo_hook "post-new" expected output\r
182  notmuch new > /dev/null\r
183 -test_expect_equal_file expected output\r
184 +test_expect_equal_file output expected\r
185  \r
186  test_begin_subtest "pre-new is run before post-new"\r
187  rm_hooks\r
188 @@ -51,7 +51,7 @@ generate_message\r
189  create_echo_hook "pre-new" pre-new.expected pre-new.output\r
190  create_echo_hook "post-new" post-new.expected post-new.output\r
191  notmuch new > /dev/null\r
192 -test_expect_equal_file post-new.expected post-new.output\r
193 +test_expect_equal_file post-new.output post-new.expected\r
194  \r
195  test_begin_subtest "pre-new non-zero exit status (hook status)"\r
196  rm_hooks\r
197 @@ -77,7 +77,7 @@ NOTMUCH_NEW 2>output.stderr >output\r
198  cat output.stderr >> output\r
199  echo "Added 1 new message to the database." > expected\r
200  echo "Error: post-new hook failed with status 13" >> expected\r
201 -test_expect_equal_file expected output\r
202 +test_expect_equal_file output expected\r
203  \r
204  # depends on the previous subtest leaving broken hook behind\r
205  test_expect_code 1 "post-new non-zero exit status (notmuch status)" "notmuch new"\r
206 diff --git a/test/multipart b/test/multipart\r
207 index 2dd73f5..c25cdf6 100755\r
208 --- a/test/multipart\r
209 +++ b/test/multipart\r
210 @@ -2,7 +2,7 @@\r
211  test_description="output of multipart message"\r
212  . ./test-lib.sh\r
213  \r
214 -cat <<EOF > embedded_message\r
215 +cat <<EOF > embedded_message.expected\r
216  From: Carl Worth <cworth@cworth.org>\r
217  To: cworth@cworth.org\r
218  Subject: html message\r
219 @@ -25,7 +25,7 @@ This is an embedded message, with a multipart/alternative part.\r
220  --==-=-==--\r
221  EOF\r
222  \r
223 -cat <<EOF > ${MAIL_DIR}/multipart\r
224 +cat <<EOF > ${MAIL_DIR}/multipart.expected\r
225  From: Carl Worth <cworth@cworth.org>\r
226  To: cworth@cworth.org\r
227  Subject: Multipart message\r
228 @@ -44,8 +44,8 @@ Content-Type: message/rfc822\r
229  Content-Disposition: inline\r
230  \r
231  EOF\r
232 -cat embedded_message >> ${MAIL_DIR}/multipart\r
233 -cat <<EOF >> ${MAIL_DIR}/multipart\r
234 +cat embedded_message.expected >> ${MAIL_DIR}/multipart.expected\r
235 +cat <<EOF >> ${MAIL_DIR}/multipart.expected\r
236  --=-=-=\r
237  Content-Disposition: attachment; filename=attachment\r
238  \r
239 @@ -108,7 +108,7 @@ notmuch new > /dev/null\r
240  test_begin_subtest "--format=text --part=0, full message"\r
241  notmuch show --format=text --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
242  cat <<EOF >EXPECTED\r
243 -\f\r
244 message{ id:87liy5ap00.fsf@yoom.home.cworth.org depth:0 match:1 filename:${MAIL_DIR}/multipart\r
245 +\f\r
246 message{ id:87liy5ap00.fsf@yoom.home.cworth.org depth:0 match:1 filename:${MAIL_DIR}/multipart.expected\r
247  \f\r
248 header{\r
249  Carl Worth <cworth@cworth.org> (2001-01-05) (attachment inbox signed unread)\r
250  Subject: Multipart message\r
251 @@ -322,7 +322,7 @@ notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' | s\r
252  echo >>OUTPUT # expect *no* newline at end of output\r
253  cat <<EOF >EXPECTED\r
254  \r
255 -{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "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", "Cc": "", "Bcc": "", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [\r
256 +{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "filename": "${MAIL_DIR}/multipart.expected", "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", "Cc": "", "Bcc": "", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [\r
257  {"id": 1, "content-type": "multipart/signed", "content": [\r
258  {"id": 2, "content-type": "multipart/mixed", "content": [\r
259  {"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Subject": "html message", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
260 @@ -441,11 +441,11 @@ test_expect_success \\r
261  \r
262  test_begin_subtest "--format=raw"\r
263  notmuch show --format=raw 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
264 -test_expect_equal_file OUTPUT "${MAIL_DIR}"/multipart\r
265 +test_expect_equal_file OUTPUT "${MAIL_DIR}"/multipart.expected\r
266  \r
267  test_begin_subtest "--format=raw --part=0, full message"\r
268  notmuch show --format=raw --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
269 -test_expect_equal_file OUTPUT "${MAIL_DIR}"/multipart\r
270 +test_expect_equal_file OUTPUT "${MAIL_DIR}"/multipart.expected\r
271  \r
272  test_begin_subtest "--format=raw --part=1, message body"\r
273  notmuch show --format=raw --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
274 @@ -494,7 +494,7 @@ test_begin_subtest "--format=raw --part=3, rfc822 part"\r
275  test_subtest_known_broken\r
276  \r
277  notmuch show --format=raw --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
278 -test_expect_equal_file OUTPUT embedded_message\r
279 +test_expect_equal_file OUTPUT embedded_message.expected\r
280  \r
281  test_begin_subtest "--format=raw --part=4, rfc822's html part"\r
282  notmuch show --format=raw --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
283 @@ -556,7 +556,7 @@ test_expect_success \\r
284  test_begin_subtest "--format=mbox"\r
285  notmuch show --format=mbox 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
286  printf "From cworth@cworth.org Fri Jan  5 15:43:57 2001\n" >EXPECTED\r
287 -cat "${MAIL_DIR}"/multipart >>EXPECTED\r
288 +cat "${MAIL_DIR}"/multipart.expected >>EXPECTED\r
289  # mbox output is expected to include a blank line\r
290  echo >>EXPECTED\r
291  test_expect_equal_file OUTPUT EXPECTED\r
292 diff --git a/test/search-limiting b/test/search-limiting\r
293 index 303762c..e93c76a 100755\r
294 --- a/test/search-limiting\r
295 +++ b/test/search-limiting\r
296 @@ -8,19 +8,19 @@ for outp in messages threads; do\r
297      test_begin_subtest "${outp}: limit does the right thing"\r
298      notmuch search --output=${outp} "*" | head -n 20 >expected\r
299      notmuch search --output=${outp} --limit=20 "*" >output\r
300 -    test_expect_equal_file expected output\r
301 +    test_expect_equal_file output expected\r
302  \r
303      test_begin_subtest "${outp}: concatenation of limited searches"\r
304      notmuch search --output=${outp} "*" | head -n 20 >expected\r
305      notmuch search --output=${outp} --limit=10 "*" >output\r
306      notmuch search --output=${outp} --limit=10 --offset=10 "*" >>output\r
307 -    test_expect_equal_file expected output\r
308 +    test_expect_equal_file output expected\r
309  \r
310      test_begin_subtest "${outp}: limit larger than result set"\r
311      N=`notmuch count --output=${outp} "*"`\r
312      notmuch search --output=${outp} "*" >expected\r
313      notmuch search --output=${outp} --limit=$((1 + ${N})) "*" >output\r
314 -    test_expect_equal_file expected output\r
315 +    test_expect_equal_file output expected\r
316  \r
317      test_begin_subtest "${outp}: limit = 0"\r
318      test_expect_equal "`notmuch search --output=${outp} --limit=0 "*"`" ""\r
319 @@ -29,43 +29,43 @@ for outp in messages threads; do\r
320      # note: tail -n +N is 1-based\r
321      notmuch search --output=${outp} "*" | tail -n +21 >expected\r
322      notmuch search --output=${outp} --offset=20 "*" >output\r
323 -    test_expect_equal_file expected output\r
324 +    test_expect_equal_file output expected\r
325  \r
326      test_begin_subtest "${outp}: offset = 0"\r
327      notmuch search --output=${outp} "*" >expected\r
328      notmuch search --output=${outp} --offset=0 "*" >output\r
329 -    test_expect_equal_file expected output\r
330 +    test_expect_equal_file output expected\r
331  \r
332      test_begin_subtest "${outp}: negative offset"\r
333      notmuch search --output=${outp} "*" | tail -n 20 >expected\r
334      notmuch search --output=${outp} --offset=-20 "*" >output\r
335 -    test_expect_equal_file expected output\r
336 +    test_expect_equal_file output expected\r
337  \r
338      test_begin_subtest "${outp}: negative offset"\r
339      notmuch search --output=${outp} "*" | tail -n 1 >expected\r
340      notmuch search --output=${outp} --offset=-1 "*" >output\r
341 -    test_expect_equal_file expected output\r
342 +    test_expect_equal_file output expected\r
343  \r
344      test_begin_subtest "${outp}: negative offset combined with limit"\r
345      notmuch search --output=${outp} "*" | tail -n 20 | head -n 10 >expected\r
346      notmuch search --output=${outp} --offset=-20 --limit=10 "*" >output\r
347 -    test_expect_equal_file expected output\r
348 +    test_expect_equal_file output expected\r
349  \r
350      test_begin_subtest "${outp}: negative offset combined with equal limit"\r
351      notmuch search --output=${outp} "*" | tail -n 20 >expected\r
352      notmuch search --output=${outp} --offset=-20 --limit=20 "*" >output\r
353 -    test_expect_equal_file expected output\r
354 +    test_expect_equal_file output expected\r
355  \r
356      test_begin_subtest "${outp}: negative offset combined with large limit"\r
357      notmuch search --output=${outp} "*" | tail -n 20 >expected\r
358      notmuch search --output=${outp} --offset=-20 --limit=50 "*" >output\r
359 -    test_expect_equal_file expected output\r
360 +    test_expect_equal_file output expected\r
361  \r
362      test_begin_subtest "${outp}: negative offset larger then results"\r
363      N=`notmuch count --output=${outp} "*"`\r
364      notmuch search --output=${outp} "*" >expected\r
365      notmuch search --output=${outp} --offset=-$((1 + ${N})) "*" >output\r
366 -    test_expect_equal_file expected output\r
367 +    test_expect_equal_file output expected\r
368  done\r
369  \r
370  test_done\r
371 diff --git a/test/symbol-hiding b/test/symbol-hiding\r
372 index 636ec91..e6d896c 100755\r
373 --- a/test/symbol-hiding\r
374 +++ b/test/symbol-hiding\r
375 @@ -27,7 +27,7 @@ test_expect_equal "$result" "$output"\r
376  \r
377  test_begin_subtest 'comparing existing to exported symbols'\r
378  objdump -t $TEST_DIRECTORY/../lib/*.o | awk '$4 == ".text" && $6 ~ "^notmuch" {print $6}' | sort | uniq > ACTUAL\r
379 -sed -n 's/[[:blank:]]*\(notmuch_[^;]*\);/\1/p' $TEST_DIRECTORY/../notmuch.sym | sort | uniq > EXPORTED\r
380 -test_expect_equal_file EXPORTED ACTUAL\r
381 +sed -n 's/[[:blank:]]*\(notmuch_[^;]*\);/\1/p' $TEST_DIRECTORY/../notmuch.sym | sort | uniq > EXPECTED\r
382 +test_expect_equal_file ACTUAL EXPECTED\r
383  \r
384  test_done\r
385 -- \r
386 1.7.9\r
387 \r