Re: [PATCH v4 16/16] add "notmuch reindex" subcommand
[notmuch-archives.git] / e1 / f6cc31eb9fa5a0c7a58d40d25009ace5a480e0
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 6D4D3431FD9\r
6         for <notmuch@notmuchmail.org>; Fri,  9 Mar 2012 17:26:38 -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 z3WO3esHAl1z for <notmuch@notmuchmail.org>;\r
17         Fri,  9 Mar 2012 17:26:37 -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 20D4D431FD7\r
22         for <notmuch@notmuchmail.org>; Fri,  9 Mar 2012 17:26:32 -0800 (PST)\r
23 Received: by mail-bk0-f53.google.com with SMTP id j4so1791432bkw.26\r
24         for <notmuch@notmuchmail.org>; Fri, 09 Mar 2012 17:26:32 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26         h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
27         bh=69I5G/MErbP0QaXBeDuxYnwhz5PPnw/eOdijPROGiBU=;\r
28         b=ioMMgPQBGqePllMisBE9f2jW6bM6+AOz2CvNLXM8lRgySLhnB7lbEIkd+bFevZ2KDj\r
29         0LBXPGzpNf05Ghk6LLX4dP9pr7wfLxAxq18Hosei+mtuU5CDbz+BR2CRaFUYtGUuODdR\r
30         xxDP/CvPtGpb5uKrIlmVysfoXQ1eFZ4GZdH/tis3YUhVyoyMwXmWJ8bbZUEl+kAcwGq+\r
31         sFVOtPrz4MIzA0gHXMZb/UQ2Q4OdKLaVRNPN09x+asIG1/0xXksCbvbJ7sCTZFraBuOe\r
32         I0GOvOmx8v9tO3xXrcDW9sC9F/ZMv9yMuHFEjHJ8w/RjVBvYM9nXlI0U7KX5YeZKrKLI\r
33         ojxg==\r
34 Received: by 10.204.129.13 with SMTP id m13mr1771210bks.119.1331342792652;\r
35         Fri, 09 Mar 2012 17:26:32 -0800 (PST)\r
36 Received: from localhost ([91.144.186.21])\r
37         by mx.google.com with ESMTPS id f5sm12030927bke.9.2012.03.09.17.26.31\r
38         (version=TLSv1/SSLv3 cipher=OTHER);\r
39         Fri, 09 Mar 2012 17:26:32 -0800 (PST)\r
40 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
41 To: notmuch@notmuchmail.org\r
42 Subject: [PATCH v2 2/2] test: use subtest name for generated message subject\r
43         by default\r
44 Date: Sat, 10 Mar 2012 05:24:51 +0400\r
45 Message-Id: <1331342691-26899-3-git-send-email-dmitry.kurochkin@gmail.com>\r
46 X-Mailer: git-send-email 1.7.9.1\r
47 In-Reply-To: <1331342691-26899-1-git-send-email-dmitry.kurochkin@gmail.com>\r
48 References: <1327961195-4204-1-git-send-email-dmitry.kurochkin@gmail.com>\r
49         <1331342691-26899-1-git-send-email-dmitry.kurochkin@gmail.com>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Sat, 10 Mar 2012 01:26:39 -0000\r
63 \r
64 Before the change, messages generated by generate_message() used "Test\r
65 message #N" for default subject where N is the generated messages\r
66 counter.  Since message subject is commonly present in expected\r
67 results, there is a chance of breaking other tests when a new\r
68 generate_message() call is added.  The patch changes default subject\r
69 value for generated messages to subtest name if it is available.  If\r
70 subtest name is not available (i.e. message is generated during test\r
71 initialization), the old default value is used (in this case it is\r
72 fine to have the counter in the subject).\r
73 \r
74 Another benefit of this change is a sane default value for subject in\r
75 generated messages, which would allow to simplify code like:\r
76 \r
77   test_begin_subtest "test for a cool feature"\r
78   add_message [subject]="message for test for a cool feature"\r
79 ---\r
80  test/encoding                |    2 +-\r
81  test/search-folder-coherence |    2 +-\r
82  test/test-lib.sh             |    6 +++++-\r
83  3 files changed, 7 insertions(+), 3 deletions(-)\r
84 \r
85 diff --git a/test/encoding b/test/encoding\r
86 index 98abf77..2e1326e 100755\r
87 --- a/test/encoding\r
88 +++ b/test/encoding\r
89 @@ -9,7 +9,7 @@ output=$(notmuch show id:${gen_msg_id} 2>&1 | notmuch_show_sanitize)\r
90  test_expect_equal "$output" "\f\r
91 message{ id:msg-001@notmuch-test-suite depth:0 match:1 excluded:0 filename:/XXX/mail/msg-001\r
92  \f\r
93 header{\r
94  Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox unread)\r
95 -Subject: Test message #1\r
96 +Subject: Message with text of unknown charset\r
97  From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
98  To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
99  Date: Fri, 05 Jan 2001 15:43:57 +0000\r
100 diff --git a/test/search-folder-coherence b/test/search-folder-coherence\r
101 index f8119cb..3f6ec76 100755\r
102 --- a/test/search-folder-coherence\r
103 +++ b/test/search-folder-coherence\r
104 @@ -32,7 +32,7 @@ test_expect_equal_file OUTPUT EXPECTED\r
105  \r
106  test_begin_subtest "Test matches folder:spam"\r
107  output=$(notmuch search folder:spam)\r
108 -test_expect_equal "$output" "thread:0000000000000001   2001-01-05 [1/1] Notmuch Test Suite; Test message #1 (inbox unread)"\r
109 +test_expect_equal "$output" "thread:0000000000000001   2001-01-05 [1/1] Notmuch Test Suite; Single new message (inbox unread)"\r
110  \r
111  test_begin_subtest "Remove folder:spam copy of email"\r
112  rm $dir/spam/$(basename $file_x)\r
113 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
114 index 2781506..06aaea2 100644\r
115 --- a/test/test-lib.sh\r
116 +++ b/test/test-lib.sh\r
117 @@ -318,7 +318,11 @@ generate_message ()\r
118      fi\r
119  \r
120      if [ -z "${template[subject]}" ]; then\r
121 -       template[subject]="Test message #${gen_msg_cnt}"\r
122 +       if [ -n "$test_subtest_name" ]; then\r
123 +           template[subject]="$test_subtest_name"\r
124 +       else\r
125 +           template[subject]="Test message #${gen_msg_cnt}"\r
126 +       fi\r
127      fi\r
128  \r
129      if [ -z "${template[date]}" ]; then\r
130 -- \r
131 1.7.9.1\r
132 \r