Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / c4 / 9010e082852efdcc5df867e096905198f161e1
1 Return-Path: <m.walters@qmul.ac.uk>\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 D7757431FB6\r
6         for <notmuch@notmuchmail.org>; Thu, 13 Dec 2012 09:27:40 -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: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 YC90gbj7nUUY for <notmuch@notmuchmail.org>;\r
17         Thu, 13 Dec 2012 09:27:39 -0800 (PST)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 91463431FBC\r
22         for <notmuch@notmuchmail.org>; Thu, 13 Dec 2012 09:27:38 -0800 (PST)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1TjCZM-0002jE-PM; Thu, 13 Dec 2012 17:27:37 +0000\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1TjCZM-0001yT-AQ; Thu, 13 Dec 2012 17:27:36 +0000\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Damien Cassou <damien.cassou@gmail.com>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH 4/4] emacs: Add unit-tests for clickable tags\r
34 In-Reply-To: <1355404167-31750-5-git-send-email-damien.cassou@gmail.com>\r
35 References: <1355404167-31750-1-git-send-email-damien.cassou@gmail.com>\r
36         <1355404167-31750-5-git-send-email-damien.cassou@gmail.com>\r
37 User-Agent: Notmuch/0.14+155~g7edfdc3 (http://notmuchmail.org) Emacs/23.4.1\r
38         (x86_64-pc-linux-gnu)\r
39 Date: Thu, 13 Dec 2012 17:27:37 +0000\r
40 Message-ID: <87k3sllv5i.fsf@qmul.ac.uk>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=us-ascii\r
43 X-Sender-Host-Address: 93.97.24.31\r
44 X-QM-SPAM-Info: Sender has good ham record.  :)\r
45 X-QM-Body-MD5: 91e54d01937d04feba19b72dad0814d7 (of first 20000 bytes)\r
46 X-SpamAssassin-Score: -1.8\r
47 X-SpamAssassin-SpamBar: -\r
48 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
49         determine if it is\r
50         spam. We require at least 5.0 points to mark a message as spam.\r
51         This message scored -1.8 points.\r
52         Summary of the scoring: \r
53         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
54         *      medium trust\r
55         *      [138.37.6.40 listed in list.dnswl.org]\r
56         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
57         provider *      (markwalters1009[at]gmail.com)\r
58         *  0.5 AWL AWL: From: address is in the auto white-list\r
59 X-QM-Scan-Virus: ClamAV says the message is clean\r
60 X-BeenThere: notmuch@notmuchmail.org\r
61 X-Mailman-Version: 2.1.13\r
62 Precedence: list\r
63 List-Id: "Use and development of the notmuch mail system."\r
64         <notmuch.notmuchmail.org>\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
68 List-Post: <mailto:notmuch@notmuchmail.org>\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
72 X-List-Received-Date: Thu, 13 Dec 2012 17:27:41 -0000\r
73 \r
74 \r
75 Hi \r
76 \r
77 I thought I had checked the test output but I am getting a failure: the\r
78 last test in emacs-show is failing (test_begin_subtest "id\r
79 buttonization")\r
80 \r
81 I think it is just saying your patch is working and making the tag inbox\r
82 in the message line a button.\r
83 \r
84 Best wishes\r
85 \r
86 Mark\r
87 \r
88 \r
89 \r
90 \r
91 \r
92  On Thu, 13 Dec 2012, Damien Cassou <damien.cassou@gmail.com> wrote:\r
93 > Signed-off-by: Damien Cassou <damien.cassou@gmail.com>\r
94 > ---\r
95 >  test/emacs |  103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
96 >  1 file changed, 103 insertions(+)\r
97 >\r
98 > diff --git a/test/emacs b/test/emacs\r
99 > index 5403930..af9d37c 100755\r
100 > --- a/test/emacs\r
101 > +++ b/test/emacs\r
102 > @@ -852,5 +852,108 @@ test_emacs "(let ((mm-text-html-renderer\r
103 >  test_expect_success "Rendering HTML mail with images" \\r
104 >      'cat OUTPUT && grep -q smiley OUTPUT'\r
105 >  \r
106 > +test_begin_subtest "Extracting all tags from a thread"\r
107 > +add_message \\r
108 > +    '[subject]="Extracting all tags from a thread"' \\r
109 > +    '[body]="body 1"'\r
110 > +parent=${gen_msg_id}\r
111 > +add_message \\r
112 > +    '[subject]="Extracting all tags from a thread"' \\r
113 > +    '[body]="body 2"' \\r
114 > +    "[in-reply-to]=\<$parent\>"\r
115 > +add_message \\r
116 > +    '[subject]="Extracting all tags from a thread"' \\r
117 > +    '[body]="body 3"' \\r
118 > +    "[in-reply-to]=\<$parent\>"\r
119 > +latest=${gen_msg_id}\r
120 > +# Extract the thread-id from one of the emails\r
121 > +thread_id=$(notmuch search --output=threads id:${latest})\r
122 > +echo THREAD ID: '"'$thread_id'"'\r
123 > +# Add tag "mytagfoo" to one of the emails\r
124 > +notmuch tag +mytagfoo id:${latest}\r
125 > +test_emacs_expect_t \\r
126 > +    "(notmuch-show \"${thread_id}\")\r
127 > +     (let ((output (notmuch-show-thread-tags))\r
128 > +           (expected '(\"inbox\" \"mytagfoo\" \"unread\")))\r
129 > +      (notmuch-test-expect-equal\r
130 > +         (sort output #'string<)\r
131 > +         (sort expected #'string<)))"\r
132 > +\r
133 > +test_begin_subtest "The tags appear in the header-line of notmuch-show"\r
134 > +add_message \\r
135 > +    '[subject]="foo bar"' \\r
136 > +    '[body]="body 1"'\r
137 > +latest=${gen_msg_id}\r
138 > +# Add tag "mytagfoo" to one of the emails\r
139 > +notmuch tag +mytagfoo id:${latest}\r
140 > +# Extract the thread-id from one of the emails\r
141 > +thread_id=$(notmuch search --output=threads id:${latest})\r
142 > +test_emacs_expect_t \\r
143 > +    "(notmuch-show \"${thread_id}\")\r
144 > +     (if (string-match-p \"mytagfoo\" (format-mode-line header-line-format))\r
145 > +         t\r
146 > +       \"The tag 'mytagfoo' was not in the header-line-format\")"\r
147 > +\r
148 > +test_begin_subtest "The tags appear in the header-line of notmuch-show even after update"\r
149 > +add_message \\r
150 > +    '[subject]="foo bar"' \\r
151 > +    '[body]="body 1"'\r
152 > +latest=${gen_msg_id}\r
153 > +# Extract the thread-id from one of the emails\r
154 > +thread_id=$(notmuch search --output=threads id:${latest})\r
155 > +test_emacs_expect_t \\r
156 > +    "(notmuch-show \"${thread_id}\")\r
157 > +     (if (string-match-p \"mytagfoo\" (format-mode-line header-line-format))\r
158 > +         (error \"There is no reason for 'mytagfoo' to be there.\"))\r
159 > +     (notmuch-show-tag \"+mytagfoo\")\r
160 > +     (if (string-match-p \"mytagfoo\" (format-mode-line header-line-format))\r
161 > +         t\r
162 > +       \"The tag 'mytagfoo' was not in the header-line-format\")"\r
163 > +\r
164 > +test_begin_subtest "The tags of notmuch-show emails are clickable"\r
165 > +add_message \\r
166 > +    '[subject]="foo bar"' \\r
167 > +    '[body]="body 1"'\r
168 > +latest=${gen_msg_id}\r
169 > +# Add tag "mytagfoo" to one of the emails\r
170 > +notmuch tag +mytagfoo id:${latest}\r
171 > +# Extract the thread-id from one of the emails\r
172 > +thread_id=$(notmuch search --output=threads id:${latest})\r
173 > +test_emacs_expect_t \\r
174 > +    "(notmuch-show \"${thread_id}\")\r
175 > +    (goto-char (point-min))\r
176 > +    (re-search-forward \"mytagfoo\")\r
177 > +    (backward-char) ;; to be 'in' the tag\r
178 > +    (unless (eq major-mode 'notmuch-show-mode)\r
179 > +       (error \"We must be in notmuch-show at this point but we are in %s.\" major-mode))\r
180 > +    (push-button) ;; simulate a press on the RET key\r
181 > +    (if (eq major-mode 'notmuch-search-mode)\r
182 > +        t\r
183 > +       (format \"We must be in notmuch-search at this point but we are in %s.\" major-mode))"\r
184 > +\r
185 > +test_begin_subtest "The tags of notmuch-show emails are clickable even after update"\r
186 > +add_message \\r
187 > +    '[subject]="foo bar"' \\r
188 > +    '[body]="body 1"'\r
189 > +latest=${gen_msg_id}\r
190 > +# Extract the thread-id from one of the emails\r
191 > +thread_id=$(notmuch search --output=threads id:${latest})\r
192 > +test_emacs_expect_t \\r
193 > +    "(notmuch-show \"${thread_id}\")\r
194 > +    (goto-char (point-min))\r
195 > +    (if (re-search-forward \"mytagfoo\" nil t)\r
196 > +         (error \"There is no reason for 'mytagfoo' to be there.\"))\r
197 > +    (notmuch-show-tag \"+mytagfoo\")\r
198 > +    (goto-char (point-min))\r
199 > +    (unless (re-search-forward \"mytagfoo\" nil t)\r
200 > +         (error \"The tag 'mytagfoo' must have been there.\"))\r
201 > +    (backward-char) ;; to be 'in' the tag\r
202 > +    (unless (eq major-mode 'notmuch-show-mode)\r
203 > +       (error \"We must be in notmuch-show at this point but we are in %s.\" major-mode))\r
204 > +    (push-button) ;; simulate a press on the RET key\r
205 > +    (if (eq major-mode 'notmuch-search-mode)\r
206 > +        t\r
207 > +       (format \"We must be in notmuch-search at this point but we are in %s.\" major-mode))"\r
208 > +\r
209 >  \r
210 >  test_done\r
211 > -- \r
212 > 1.7.10.4\r
213 >\r
214 > _______________________________________________\r
215 > notmuch mailing list\r
216 > notmuch@notmuchmail.org\r
217 > http://notmuchmail.org/mailman/listinfo/notmuch\r