Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 5a / a0ddb85c294c681c675393485c98a5c3a3e4a3
1 Return-Path: <jani@nikula.org>\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 DE9AF431FB6\r
6         for <notmuch@notmuchmail.org>; Wed,  5 Dec 2012 00:05:13 -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.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id Cu2zubNyPTDE for <notmuch@notmuchmail.org>;\r
16         Wed,  5 Dec 2012 00:05:09 -0800 (PST)\r
17 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
18         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 7FD2C431FAE\r
21         for <notmuch@notmuchmail.org>; Wed,  5 Dec 2012 00:05:09 -0800 (PST)\r
22 Received: by mail-bk0-f53.google.com with SMTP id j5so2483076bkw.26\r
23         for <notmuch@notmuchmail.org>; Wed, 05 Dec 2012 00:05:06 -0800 (PST)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type:content-transfer-encoding\r
28         :x-gm-message-state;\r
29         bh=9OMgv09kG5TCAVbaJL40xkKo8m/w1VEr8rsEfsSvNL0=;\r
30         b=h+sgLGqxTUKFdYWLw9yIyjZs4Zs1lzr4QnE+DOt4GSVJSy3BQIhui9ZfTNoo5bUCNX\r
31         M18c1Vhr/G7GAyv7uz2iFqU+0m5mSvKJ6wA2pIQeuaFObUTK8JRag7RDpbqpvd+MX8Xw\r
32         RhSFWfJ1L8fbCvCFBGzVjCB2ZCCg30IqmVGjXVDhkZS450MzPbnqCRIwJEmAIeDB/X5r\r
33         yubAdTQ94RXRqCF6Vq2JH8iiAXME3NfVzA3GnXiuUjcj+AcJ9em3qVGCtVDDQzgn1nza\r
34         7aCEuzlxYqTimhRAbeQ+aql/ZXD/cV0XlQuPanc8u/CLL/BLZzFpn9kmYxUn/8LUMaP8\r
35         YFQw==\r
36 Received: by 10.204.157.26 with SMTP id z26mr4970992bkw.101.1354694706683;\r
37         Wed, 05 Dec 2012 00:05:06 -0800 (PST)\r
38 Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])\r
39         by mx.google.com with ESMTPS id f24sm2804896bkv.7.2012.12.05.00.05.04\r
40         (version=SSLv3 cipher=OTHER); Wed, 05 Dec 2012 00:05:05 -0800 (PST)\r
41 From: Jani Nikula <jani@nikula.org>\r
42 To: Michal Nazarewicz <mina86@mina86.com>, notmuch@notmuchmail.org\r
43 Subject: Re: [PATCH 1/3] test: fix count test\r
44 In-Reply-To: <xa1tfw3l2zd7.fsf@mina86.com>\r
45 References: <cover.1354656085.git.jani@nikula.org>\r
46         <0ca075ab5fb0d886d0235c1f0549db8b0b14c9b5.1354656085.git.jani@nikula.org>\r
47         <xa1tfw3l2zd7.fsf@mina86.com>\r
48 User-Agent: Notmuch/0.14+137~gda2ee8b (http://notmuchmail.org) Emacs/23.2.1\r
49         (x86_64-pc-linux-gnu)\r
50 Date: Wed, 05 Dec 2012 09:05:00 +0100\r
51 Message-ID: <877gowudoz.fsf@nikula.org>\r
52 MIME-Version: 1.0\r
53 Content-Type: text/plain; charset=utf-8\r
54 Content-Transfer-Encoding: quoted-printable\r
55 X-Gm-Message-State:\r
56  ALoCoQk4193NvaBs+nQcFJj69Fwh98YPfN+UEONtcv1x2qR34yraTB9egxI+1L8ijOJX0nVTS21f\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Wed, 05 Dec 2012 08:05:14 -0000\r
70 \r
71 On Wed, 05 Dec 2012, Michal Nazarewicz <mina86@mina86.com> wrote:\r
72 > On Tue, Dec 04 2012, Jani Nikula wrote:\r
73 >> The quoting for ${SEARCH} is broken when it's supposed to be '*', and\r
74 >\r
75 > Why is it broken?  It does not appear to be broken to me and in fact the\r
76 > test passes.\r
77 \r
78 This is exactly why nobody noticed before. It looks all right and the\r
79 test passes...\r
80 \r
81 >> it seems tricky to get it right. Just drop the variable and use '*'\r
82 >> directly. Before this, none of the messages ever matched, and the test\r
83 >> was comparing zeros.\r
84 \r
85 ...but the query does not find anything, and the test compares zero\r
86 results to zero results. Please try this patch, which should pass if\r
87 everything were all right:\r
88 \r
89 diff --git a/test/count b/test/count\r
90 index 300b171..ecae40e 100755\r
91 --- a/test/count\r
92 +++ b/test/count\r
93 @@ -6,6 +6,11 @@ add_email_corpus\r
94 =20\r
95  SEARCH=3D"\"*\""\r
96 =20\r
97 +test_begin_subtest "check the query"\r
98 +test_expect_equal \\r
99 +    "`notmuch count ${SEARCH}`" \\r
100 +    "`notmuch count '*'`"\r
101 +\r
102  test_begin_subtest "message count is the default for notmuch count"\r
103  test_expect_equal \\r
104      "`notmuch search --output=3Dmessages ${SEARCH} | wc -l`" \\r
105 \r
106 --=20\r
107 \r
108 At least for me this produces:\r
109 \r
110  FAIL   check the query\r
111  --- count.1.expected   2012-12-05 08:01:09.004751327 +0000\r
112  +++ count.1.output     2012-12-05 08:01:09.004751327 +0000\r
113  @@ -1 +1 @@\r
114  -52\r
115  +0\r
116 \r
117 And because it seems to be really hard to get the quoting right, and\r
118 keep it that way, I think it's more robust just to s/${SEARCH}/'*'/.\r
119 \r
120 \r
121 BR,\r
122 Jani.\r
123 \r
124 \r
125 >> ---\r
126 >>  test/count |   23 ++++++++++-------------\r
127 >>  1 file changed, 10 insertions(+), 13 deletions(-)\r
128 >>\r
129 >> diff --git a/test/count b/test/count\r
130 >> index 300b171..8e587ff 100755\r
131 >> --- a/test/count\r
132 >> +++ b/test/count\r
133 >> @@ -4,37 +4,34 @@ test_description=3D'"notmuch count" for messages and t=\r
134 hreads'\r
135 >>=20=20\r
136 >>  add_email_corpus\r
137 >>=20=20\r
138 >> -SEARCH=3D"\"*\""\r
139 >> -\r
140 >>  test_begin_subtest "message count is the default for notmuch count"\r
141 >>  test_expect_equal \\r
142 >> -    "`notmuch search --output=3Dmessages ${SEARCH} | wc -l`" \\r
143 >> -    "`notmuch count ${SEARCH}`"\r
144 >> +    "`notmuch search --output=3Dmessages '*' | wc -l`" \\r
145 >> +    "`notmuch count '*'`"\r
146 >>=20=20\r
147 >>  test_begin_subtest "message count with --output=3Dmessages"\r
148 >>  test_expect_equal \\r
149 >> -    "`notmuch search --output=3Dmessages ${SEARCH} | wc -l`" \\r
150 >> -    "`notmuch count --output=3Dmessages ${SEARCH}`"\r
151 >> +    "`notmuch search --output=3Dmessages '*' | wc -l`" \\r
152 >> +    "`notmuch count --output=3Dmessages '*'`"\r
153 >>=20=20\r
154 >>  test_begin_subtest "thread count with --output=3Dthreads"\r
155 >>  test_expect_equal \\r
156 >> -    "`notmuch search --output=3Dthreads ${SEARCH} | wc -l`" \\r
157 >> -    "`notmuch count --output=3Dthreads ${SEARCH}`"\r
158 >> +    "`notmuch search --output=3Dthreads '*' | wc -l`" \\r
159 >> +    "`notmuch count --output=3Dthreads '*'`"\r
160 >>=20=20\r
161 >>  test_begin_subtest "thread count is the default for notmuch search"\r
162 >>  test_expect_equal \\r
163 >> -    "`notmuch search ${SEARCH} | wc -l`" \\r
164 >> -    "`notmuch count --output=3Dthreads ${SEARCH}`"\r
165 >> +    "`notmuch search '*' | wc -l`" \\r
166 >> +    "`notmuch count --output=3Dthreads '*'`"\r
167 >>=20=20\r
168 >> -SEARCH=3D"from:cworth and not from:cworth"\r
169 >>  test_begin_subtest "count with no matching messages"\r
170 >>  test_expect_equal \\r
171 >>      "0" \\r
172 >> -    "`notmuch count --output=3Dmessages ${SEARCH}`"\r
173 >> +    "`notmuch count --output=3Dmessages from:cworth and not from:cworth=\r
174 `"\r
175 >>=20=20\r
176 >>  test_begin_subtest "count with no matching threads"\r
177 >>  test_expect_equal \\r
178 >>      "0" \\r
179 >> -    "`notmuch count --output=3Dthreads ${SEARCH}`"\r
180 >> +    "`notmuch count --output=3Dthreads from:cworth and not from:cworth`"\r
181 >>=20=20\r
182 >>  test_done\r
183 >\r
184 > --=20\r
185 > Best regards,                                         _     _\r
186 > .o. | Liege of Serenely Enlightened Majesty of      o' \,=3D./ `o\r
187 > ..o | Computer Science,  Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz =\r
188    (o o)\r
189 > ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--\r