[PATCH v2 (rebased) 0/3] Improve the display of matching/non-matching authors.
[notmuch-archives.git] / 98 / 71090a60d740f9de1f326ec84045002f1bec45
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 8AFC3429E36\r
6         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 09:54:18 -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 evPb2IEqxj2J for <notmuch@notmuchmail.org>;\r
17         Wed, 25 Jan 2012 09:54:17 -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 7FAAC431FBC\r
22         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 09:54:17 -0800 (PST)\r
23 Received: by bkbzt19 with SMTP id zt19so3707541bkb.26\r
24         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 09:54:16 -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:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type;\r
28         bh=xVhSOIagv9ebAcH2NGHWWZQ1K5OwTXydi8Iah9Ytv9Q=;\r
29         b=kSRU78cbydctMIIrCkM+bNe6D7NpFDnzw0gslfSUX+UFjkzI36f9/L3J7CIYDEOBvl\r
30         dXvGLbQU4eNfux1LmEOLDt7EaFe4Q88BfsXDkDbJLp84kWGuBV8AFq8nsdC4rdmjvBk3\r
31         R9YiZWM4EtAahcngowG9PF88AFMcHj/DZFvJ4=\r
32 Received: by 10.204.153.27 with SMTP id i27mr7512253bkw.81.1327514056074;\r
33         Wed, 25 Jan 2012 09:54:16 -0800 (PST)\r
34 Received: from localhost ([91.144.186.21])\r
35         by mx.google.com with ESMTPS id t17sm2615195bke.6.2012.01.25.09.54.14\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Wed, 25 Jan 2012 09:54:15 -0800 (PST)\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
39 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
40 Subject: Re: [PATCH 3/4 v2] test: Add test for Original Message hiding at\r
41         point-min.\r
42 In-Reply-To: <1327506328-22126-4-git-send-email-dme@dme.org>\r
43 References: <1327503908-17226-1-git-send-email-dme@dme.org>\r
44         <1327506328-22126-1-git-send-email-dme@dme.org>\r
45         <1327506328-22126-4-git-send-email-dme@dme.org>\r
46 User-Agent: Notmuch/0.11+116~ge6e10b8 (http://notmuchmail.org) Emacs/23.3.1\r
47         (x86_64-pc-linux-gnu)\r
48 Date: Wed, 25 Jan 2012 21:53:08 +0400\r
49 Message-ID: <87liovhdob.fsf@gmail.com>\r
50 MIME-Version: 1.0\r
51 Content-Type: text/plain; charset=us-ascii\r
52 X-BeenThere: notmuch@notmuchmail.org\r
53 X-Mailman-Version: 2.1.13\r
54 Precedence: list\r
55 List-Id: "Use and development of the notmuch mail system."\r
56         <notmuch.notmuchmail.org>\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
60 List-Post: <mailto:notmuch@notmuchmail.org>\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
64 X-List-Received-Date: Wed, 25 Jan 2012 17:54:18 -0000\r
65 \r
66 On Wed, 25 Jan 2012 15:45:27 +0000, David Edmondson <dme@dme.org> wrote:\r
67 > ---\r
68 >  test/emacs-original-message-hiding.el |   15 +++++++++++++++\r
69 >  test/emacs-original-message-hiding.sh |   20 ++++++++++++++++++++\r
70 >  test/notmuch-test                     |    1 +\r
71 >  3 files changed, 36 insertions(+), 0 deletions(-)\r
72 >  create mode 100644 test/emacs-original-message-hiding.el\r
73 >  create mode 100755 test/emacs-original-message-hiding.sh\r
74\r
75 > diff --git a/test/emacs-original-message-hiding.el b/test/emacs-original-message-hiding.el\r
76 > new file mode 100644\r
77 > index 0000000..bbacbeb\r
78 > --- /dev/null\r
79 > +++ b/test/emacs-original-message-hiding.el\r
80 > @@ -0,0 +1,15 @@\r
81 > +(defun notmuch-test-original-message-hiding ()\r
82 > +  (let ((notmuch-show-insert-text/plain-hook '(notmuch-wash-excerpt-citations))\r
83 \r
84 Do we have to override the default value here?  I thought\r
85 notmuch-wash-excerpt-citations was enabled by default.\r
86 \r
87 > +     (expected "\\r
88 > +Sender <sender@example.com> (2010-01-05) (inbox)\r
89 > +Subject: hiding an Original Message\r
90 > +To: mailinglist@notmuchmail.org\r
91 > +Date: Tue, 05 Jan 2010 15:43:56 -0000\r
92 > +\r
93 > +[ 2-line hidden original message. Click/Enter to show. ]\r
94 > +\r
95 > +")\r
96 > +     output)\r
97 > +    (notmuch-show "id:\"test_message@test.org\"")\r
98 > +    (setq output (visible-buffer-string))\r
99 > +    (notmuch-test-expect-equal output expected)))\r
100 \r
101 IMO writing the test in lisp does not give any benefit in this case.\r
102 Quite the opposite: a simple test is split in two files and becomes more\r
103 complex.\r
104 \r
105 But since we accepted this way of writing tests and you seem to prefer\r
106 it, I would not argue about changing it.\r
107 \r
108 > diff --git a/test/emacs-original-message-hiding.sh b/test/emacs-original-message-hiding.sh\r
109 > new file mode 100755\r
110 > index 0000000..01cf98d\r
111 > --- /dev/null\r
112 > +++ b/test/emacs-original-message-hiding.sh\r
113 \r
114 Let's rename this file to something a bit more general, e.g.\r
115 emacs-message-hiding.  Then we can put new tests (and move all\r
116 existing!) related to hiding message parts into it.\r
117 \r
118 > @@ -0,0 +1,20 @@\r
119 > +#!/usr/bin/env bash\r
120 > +\r
121 > +test_description="emacs Original Message hiding"\r
122 > +. test-lib.sh\r
123 > +\r
124 > +test_begin_subtest "Hiding an Original Message region at point-min"\r
125 > +add_message \\r
126 > +    '[id]="test_message@test.org"' \\r
127 \r
128 The message-id should be more unique to avoid collisions with other\r
129 tests.  IMO deriving message-id from the test description is a good\r
130 practice.  Also, consider assigning it to a variable and using it\r
131 instead of the string.  Since part of the test is in lisp, it is tricky\r
132 to use this variable in it.  Perhaps we should pass it as a parameter to\r
133 notmuch-test-original-message-hiding?  Or just do not bother and use\r
134 string constants :)  Your choice.\r
135 \r
136 Regards,\r
137   Dmitry\r
138 \r
139 > +    '[from]="Sender <sender@example.com>"' \\r
140 > +    '[to]=mailinglist@notmuchmail.org' \\r
141 > +    '[subject]="hiding an Original Message"' \\r
142 > +    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
143 > +    '[body]="-----Original Message-----\r
144 > +Text here.\r
145 > +"'\r
146 > +test_subtest_known_broken\r
147 > +test_emacs_expect_t \\r
148 > +    '(load "emacs-original-message-hiding.el") (notmuch-test-original-message-hiding)'\r
149 > +\r
150 > +test_done\r
151 > diff --git a/test/notmuch-test b/test/notmuch-test\r
152 > index 3f1740c..af132fc 100755\r
153 > --- a/test/notmuch-test\r
154 > +++ b/test/notmuch-test\r
155 > @@ -54,6 +54,7 @@ TESTS="\r
156 >    argument-parsing\r
157 >    emacs-test-functions.sh\r
158 >    emacs-address-cleaning.sh\r
159 > +  emacs-original-message-hiding.sh\r
160 >  "\r
161 >  TESTS=${NOTMUCH_TESTS:=$TESTS}\r
162 >  \r
163 > -- \r
164 > 1.7.8.3\r
165\r
166 > _______________________________________________\r
167 > notmuch mailing list\r
168 > notmuch@notmuchmail.org\r
169 > http://notmuchmail.org/mailman/listinfo/notmuch\r