Re: folder: search-term problems
[notmuch-archives.git] / bc / 06d94b4824911b9bbc0681a6b49d445e171a2e
1 Return-Path: <amdragon@mit.edu>\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 78A98431FAF\r
6         for <notmuch@notmuchmail.org>; Wed,  3 Oct 2012 07:28:38 -0700 (PDT)\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 g7dKjNJusmxl for <notmuch@notmuchmail.org>;\r
16         Wed,  3 Oct 2012 07:28:38 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU\r
18         [18.9.25.15])\r
19         by olra.theworths.org (Postfix) with ESMTP id D231D431FAE\r
20         for <notmuch@notmuchmail.org>; Wed,  3 Oct 2012 07:28:37 -0700 (PDT)\r
21 X-AuditID: 1209190f-b7f636d00000095b-a1-506c4b95e4a1\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 90.BB.02395.59B4C605; Wed,  3 Oct 2012 10:28:37 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q93ESaqe026187; \r
27         Wed, 3 Oct 2012 10:28:37 -0400\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q93ESY1D027134\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Wed, 3 Oct 2012 10:28:35 -0400 (EDT)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1TJPwA-0008E8-Ai; Wed, 03 Oct 2012 10:28:34 -0400\r
37 Date: Wed, 3 Oct 2012 10:28:34 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
40 Subject: Re: [PATCH 2/3] test: Add a test for HTML email with inline images\r
41 Message-ID: <20121003142834.GC14861@mit.edu>\r
42 References: <1348941314-8377-1-git-send-email-amdragon@mit.edu>\r
43         <1348941314-8377-3-git-send-email-amdragon@mit.edu>\r
44         <87a9w3vqye.fsf@gmail.com>\r
45 MIME-Version: 1.0\r
46 Content-Type: text/plain; charset=us-ascii\r
47 Content-Disposition: inline\r
48 In-Reply-To: <87a9w3vqye.fsf@gmail.com>\r
49 User-Agent: Mutt/1.5.21 (2010-09-15)\r
50 X-Brightmail-Tracker:\r
51  H4sIAAAAAAAAA+NgFprAKsWRmVeSWpSXmKPExsUixG6nrjvVOyfAYMl2cYurW/vZLa7fnMns\r
52         wOSxc9Zddo9nq24xBzBFcdmkpOZklqUW6dslcGUcWX+PqWCBSMWlWV9ZGxinCHQxcnJICJhI\r
53         /F7ZwwJhi0lcuLeeDcQWEtjHKLHsRUEXIxeQvZ5R4tva1YwQzgkmiYdzFkE5SxglZny+wwTS\r
54         wiKgIjF18ypmEJtNQENi2/7ljCC2iIChxK2Lr8DizALSEt9+N4PVCwt4S3S9bABbzSugI9Ex\r
55         oYkdYugkRolDs1azQSQEJU7OfMIC0awlcePfS6BmDrBBy/9xgIQ5BdQlHi9aBFYuCnTDlJPb\r
56         2CYwCs1C0j0LSfcshO4FjMyrGGVTcqt0cxMzc4pTk3WLkxPz8lKLdE30cjNL9FJTSjcxggKb\r
57         U5J/B+O3g0qHGAU4GJV4eCX+ZwUIsSaWFVfmHmKU5GBSEuUVccsJEOJLyk+pzEgszogvKs1J\r
58         LT7EKMHBrCTC62oDlONNSaysSi3Kh0lJc7AoifNeTbnpLySQnliSmp2aWpBaBJOV4eBQkuCN\r
59         8wJqFCxKTU+tSMvMKUFIM3FwggznARq+1hNkeHFBYm5xZjpE/hSjLsfOEwseMAqx5OXnpUqJ\r
60         8x4DGSQAUpRRmgc3B5aQXjGKA70lzJsNUsUDTGZwk14BLWECWrJCNwtkSUkiQkqqgTGLz16a\r
61         02A/a/z/Z4XRt08cuTZT3vbwg1/PC/LlHJ5Pvy/+2641KfxkYEcf76dJVw/eErS22qs1y3zv\r
62         JAeHDevcjvvsVZY6u2LWS55My0vPXmnck3tfu+rbTtu+0qtXZIRWV+TZmM2rZsxdpPOR9X9u\r
63         wO+v2qJfrwVv/ln8ec6eo2GPn/341vNJiaU4I9FQi7moOBEAn+sdESMDAAA=\r
64 Cc: notmuch@notmuchmail.org\r
65 X-BeenThere: notmuch@notmuchmail.org\r
66 X-Mailman-Version: 2.1.13\r
67 Precedence: list\r
68 List-Id: "Use and development of the notmuch mail system."\r
69         <notmuch.notmuchmail.org>\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
73 List-Post: <mailto:notmuch@notmuchmail.org>\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
76         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
77 X-List-Received-Date: Wed, 03 Oct 2012 14:28:38 -0000\r
78 \r
79 Quoth Dmitry Kurochkin on Oct 03 at  1:35 pm:\r
80 > Hi Austin.\r
81\r
82 > Austin Clements <amdragon@MIT.EDU> writes:\r
83\r
84 > > Currently this test passes in Emacs 23 but fails in Emacs 24 (at least\r
85 > > on some Linux distributions).\r
86\r
87 > The test fails for me on Emacs 23.4.1 (Debian unstable):\r
88\r
89 >  FAIL   Rendering HTML mail with images\r
90 >       --- emacs.51.OUTPUT     2012-10-03 09:31:33.383529764 +0000\r
91 >       +++ emacs.51.EXPECTED   2012-10-03 09:31:33.383529764 +0000\r
92 >       @@ -6,4 +6,3 @@\r
93 >        [ multipart/related ]\r
94 >        [ text/html ]\r
95 >        *\r
96 >       -\r
97\r
98 > Did not look into details.\r
99 \r
100 Yes.  This test is (in hindsight, unsurprisingly) sensitive to\r
101 whatever HTML renderer Emacs chooses.  It looks like you're probably\r
102 using html2text, which outputs nothing for an image.  Unfortunately,\r
103 none of the built-in renderers in Emacs 23 are aware of content\r
104 references, which makes this test rather pointless on Emacs 23 unless\r
105 we depend on an external renderer.\r
106 \r
107 The best solution I can think of dynamically chooses shr on Emacs 24\r
108 (since that's really what we're trying to test) and gives up on Emacs\r
109 23 and forcibly selects html2text (test patch below).  Alternatively,\r
110 we could cycle through all of the available renderers, test everything\r
111 that we can, and just ignore everything that we can't run, though that\r
112 would make the test environment-sensitive.\r
113 \r
114 diff --git a/test/emacs b/test/emacs\r
115 index 1f84b91..2ef78bf 100755\r
116 --- a/test/emacs\r
117 +++ b/test/emacs\r
118 @@ -756,7 +756,7 @@ add_message '[subject]="HTML mail with images"' \\r
119      '[body]="--abcd\r
120  Content-Type: text/html\r
121  \r
122 -<img src="cid:330@goomoji.gmail">\r
123 +<img src="cid:330@goomoji.gmail"> smiley\r
124  \r
125  --abcd\r
126  Content-Type: image/gif\r
127 @@ -766,10 +766,13 @@ Content-ID: <330@goomoji.gmail>\r
128  R0lGODlhDAAMAKIFAF5LAP/zxAAAANyuAP/gaP///wAAAAAAACH5BAEAAAUALAAAAAAMAAwAAAMl\r
129  WLPcGjDKFYi9lxKBOaGcF35DhWHamZUW0K4mAbiwWtuf0uxFAgA7\r
130  --abcd--"'\r
131 -test_emacs "(notmuch-show \"id:${gen_msg_id}\")\r
132 +test_emacs "(let ((mm-text-html-renderer\r
133 +                  (if (assq 'shr mm-text-html-renderer-alist)\r
134 +                      'shr 'html2text)))\r
135 +             (notmuch-show \"id:${gen_msg_id}\"))\r
136             (test-output)"\r
137  # Normalize output for Emacs 23 and Emacs 24\r
138 -sed -i 's/\[cid\]/*/' OUTPUT\r
139 +sed -i 's/^ smiley/* smiley/' OUTPUT\r
140  cat <<EOF >EXPECTED\r
141  Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)\r
142  Subject: HTML mail with images\r
143 @@ -778,7 +781,7 @@ Date: Fri, 05 Jan 2001 15:43:57 +0000\r
144  \r
145  [ multipart/related ]\r
146  [ text/html ]\r
147 -*\r
148 +* smiley\r
149  EOF\r
150  test_expect_equal_file OUTPUT EXPECTED\r
151  \r
152 \r