Re: [PATCH v4 16/16] add "notmuch reindex" subcommand
[notmuch-archives.git] / 02 / b0c51e9a4866898f4f71ba4c3e940477300fdc
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 7E8F1431E64\r
6         for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 14:07:50 -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 PCoEc-+497Xx for <notmuch@notmuchmail.org>;\r
17         Mon, 30 Jan 2012 14:07:49 -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 A8AA4431FBC\r
22         for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 14:07:49 -0800 (PST)\r
23 Received: by mail-bk0-f53.google.com with SMTP id 11so1911694bke.26\r
24         for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 14:07:49 -0800 (PST)\r
25 Received-SPF: pass (google.com: domain of dmitry.kurochkin@gmail.com\r
26         designates 10.204.152.145 as permitted sender)\r
27         client-ip=10.204.152.145; \r
28 Authentication-Results: mr.google.com; spf=pass (google.com: domain of\r
29         dmitry.kurochkin@gmail.com designates 10.204.152.145 as\r
30         permitted sender) smtp.mail=dmitry.kurochkin@gmail.com;\r
31         dkim=pass header.i=dmitry.kurochkin@gmail.com\r
32 Received: from mr.google.com ([10.204.152.145])\r
33         by 10.204.152.145 with SMTP id g17mr10538015bkw.97.1327961269409\r
34         (num_hops = 1); Mon, 30 Jan 2012 14:07:49 -0800 (PST)\r
35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
36         h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
37         bh=hwQzn4cLgMkdVaVefZITkYqmq0w/TNq/tgJVYEwf/3Y=;\r
38         b=HYi+6KQyXIaY3X2trHAuEyGWg7yJHyZ0ykAtkFDQ5yxVkEpWbLqUmjDWBL16YmH0Vo\r
39         y6eiPmJ+hgMxMbtlboMdwXfZM8rHVbSAN1a6o08VBmnz1xId3BcZk7pXSAEyzNgXJZmU\r
40         AqbO962HCpxOtaBjQqZELMJ4AFDtYEOgPUw4M=\r
41 Received: by 10.204.152.145 with SMTP id g17mr9149983bkw.97.1327961269326;\r
42         Mon, 30 Jan 2012 14:07:49 -0800 (PST)\r
43 Received: from localhost ([91.144.186.21])\r
44         by mx.google.com with ESMTPS id ez5sm40482935bkc.15.2012.01.30.14.07.48\r
45         (version=TLSv1/SSLv3 cipher=OTHER);\r
46         Mon, 30 Jan 2012 14:07:48 -0800 (PST)\r
47 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
48 To: notmuch@notmuchmail.org\r
49 Subject: [PATCH 2/2] test: use subtest name for generated message subject by\r
50         default\r
51 Date: Tue, 31 Jan 2012 02:06:35 +0400\r
52 Message-Id: <1327961195-4204-2-git-send-email-dmitry.kurochkin@gmail.com>\r
53 X-Mailer: git-send-email 1.7.8.3\r
54 In-Reply-To: <1327961195-4204-1-git-send-email-dmitry.kurochkin@gmail.com>\r
55 References: <1327961195-4204-1-git-send-email-dmitry.kurochkin@gmail.com>\r
56 X-BeenThere: notmuch@notmuchmail.org\r
57 X-Mailman-Version: 2.1.13\r
58 Precedence: list\r
59 List-Id: "Use and development of the notmuch mail system."\r
60         <notmuch.notmuchmail.org>\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
64 List-Post: <mailto:notmuch@notmuchmail.org>\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
68 X-List-Received-Date: Mon, 30 Jan 2012 22:07:50 -0000\r
69 \r
70 Before the change, messages generated by generate_message() used "Test\r
71 message #N" for default subject where N is the generated messages\r
72 counter.  Since message subject is commonly present in expected\r
73 results, there is a chance of breaking other tests when a new\r
74 generate_message() call is added.  The patch changes default subject\r
75 value for generated messages to subtest name if it is available.  If\r
76 subtest name is not available (i.e. message is generated during test\r
77 initialization), the old default value is used (in this case it is\r
78 fine to have the counter in the subject).\r
79 \r
80 Another benefit of this change is a sane default value for subject in\r
81 generated messages, which would allow to simplify code like:\r
82 \r
83   test_begin_subtest "test for a cool feature"\r
84   add_message [subject]="message for test for a cool feature"\r
85 ---\r
86  test/encoding                |    2 +-\r
87  test/search-folder-coherence |    2 +-\r
88  test/test-lib.sh             |    6 +++++-\r
89  3 files changed, 7 insertions(+), 3 deletions(-)\r
90 \r
91 diff --git a/test/encoding b/test/encoding\r
92 index 33259c1..dbaceb0 100755\r
93 --- a/test/encoding\r
94 +++ b/test/encoding\r
95 @@ -9,7 +9,7 @@ output=$(notmuch show id:${gen_msg_id} 2>&1 | notmuch_show_sanitize)\r
96  test_expect_equal "$output" "\f\r
97 message{ id:msg-001@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-001\r
98  \f\r
99 header{\r
100  Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox unread)\r
101 -Subject: Test message #1\r
102 +Subject: Message with text of unknown charset\r
103  From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
104  To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
105  Date: Fri, 05 Jan 2001 15:43:57 +0000\r
106 diff --git a/test/search-folder-coherence b/test/search-folder-coherence\r
107 index f8119cb..3f6ec76 100755\r
108 --- a/test/search-folder-coherence\r
109 +++ b/test/search-folder-coherence\r
110 @@ -32,7 +32,7 @@ test_expect_equal_file OUTPUT EXPECTED\r
111  \r
112  test_begin_subtest "Test matches folder:spam"\r
113  output=$(notmuch search folder:spam)\r
114 -test_expect_equal "$output" "thread:0000000000000001   2001-01-05 [1/1] Notmuch Test Suite; Test message #1 (inbox unread)"\r
115 +test_expect_equal "$output" "thread:0000000000000001   2001-01-05 [1/1] Notmuch Test Suite; Single new message (inbox unread)"\r
116  \r
117  test_begin_subtest "Remove folder:spam copy of email"\r
118  rm $dir/spam/$(basename $file_x)\r
119 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
120 index 8158328..94efdc1 100644\r
121 --- a/test/test-lib.sh\r
122 +++ b/test/test-lib.sh\r
123 @@ -318,7 +318,11 @@ generate_message ()\r
124      fi\r
125  \r
126      if [ -z "${template[subject]}" ]; then\r
127 -       template[subject]="Test message #${gen_msg_cnt}"\r
128 +       if [ -n "$test_subtest_name" ]; then\r
129 +           template[subject]="$test_subtest_name"\r
130 +       else\r
131 +           template[subject]="Test message #${gen_msg_cnt}"\r
132 +       fi\r
133      fi\r
134  \r
135      if [ -z "${template[date]}" ]; then\r
136 -- \r
137 1.7.8.3\r
138 \r