Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 19 / 133c48970c70f6f68240f38b5d0e2ff0882b99
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 0E08E40DF1B\r
6         for <notmuch@notmuchmail.org>; Sat, 20 Nov 2010 20:32:11 -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.999\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,\r
13         DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001]\r
14         autolearn=ham\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id 5so+C8JIyPuW for <notmuch@notmuchmail.org>;\r
18         Sat, 20 Nov 2010 20:32:00 -0800 (PST)\r
19 Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com\r
20         [209.85.215.181])\r
21         by olra.theworths.org (Postfix) with ESMTP id 99DE640DF1C\r
22         for <notmuch@notmuchmail.org>; Sat, 20 Nov 2010 20:31:59 -0800 (PST)\r
23 Received: by eyb6 with SMTP id 6so3679954eyb.26\r
24         for <notmuch@notmuchmail.org>; Sat, 20 Nov 2010 20:31:56 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=domainkey-signature:received:received:from:to:subject:user-agent\r
27         :date:message-id:mime-version:content-type;\r
28         bh=n+n+7JYivFqn0iOSPaU/gmskUKdGVieZd3ROJQLUl4I=;\r
29         b=wMAbJ064NNKA8JaB7iLFGD1oFsRSQrQdfFiTVP3hBdIfYJ8tX3kZeYwOUqioEpL+kQ\r
30         4WRTEFbydF1nwqV3S8uqkM6GXR4LztK1fCBBr1P4d3ihjn8VWButK/Kw2jvPa6fzK4bg\r
31         dv34yGZVS10JiRB2KOAZ0QnMPpcAdwU8XBr7g=\r
32 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
33         h=from:to:subject:user-agent:date:message-id:mime-version\r
34         :content-type;\r
35         b=RtRu89bNQBWBWWRr9fDKe9z3bOnT2SscNJvLLQKq7pVWHY70UB6T4kI0d5yuV6XZGf\r
36         RaVQPjf3ubzv2LjIRBZpwAUlZw30TR07OjosWf1xPVCXOdrgG7XhFMzWnUH4FTWmfAGK\r
37         Jf9EMt84+VzrXupKJ1/HK8h9kfD+vluBHcBLA=\r
38 Received: by 10.213.16.207 with SMTP id p15mr6477244eba.91.1290313915996;\r
39         Sat, 20 Nov 2010 20:31:55 -0800 (PST)\r
40 Received: from localhost ([91.144.186.21])\r
41         by mx.google.com with ESMTPS id w20sm3186699eeh.12.2010.11.20.20.31.53\r
42         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
43         Sat, 20 Nov 2010 20:31:54 -0800 (PST)\r
44 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
45 To: notmuch@notmuchmail.org\r
46 Subject: [PATCH] test: Add emacs test for messages with very long subjects\r
47 User-Agent: Notmuch/0.5-2-g243ec33 (http://notmuchmail.org) Emacs/23.2.1\r
48         (x86_64-pc-linux-gnu)\r
49 Date: Sun, 21 Nov 2010 07:31:45 +0300\r
50 Message-ID: <87tyjbnvpq.fsf@gmail.com>\r
51 MIME-Version: 1.0\r
52 Content-Type: multipart/mixed; boundary="=-=-="\r
53 X-BeenThere: notmuch@notmuchmail.org\r
54 X-Mailman-Version: 2.1.13\r
55 Precedence: list\r
56 List-Id: "Use and development of the notmuch mail system."\r
57         <notmuch.notmuchmail.org>\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
61 List-Post: <mailto:notmuch@notmuchmail.org>\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
65 X-List-Received-Date: Sun, 21 Nov 2010 04:32:11 -0000\r
66 \r
67 --=-=-=\r
68 \r
69 test: Add emacs test for messages with very long subjects\r
70 \r
71 Emacs search does not show messages with very long subjects. The\r
72 main notmuch view shows unread messages but nothing in the search\r
73 results. Thus you can not remove unread tag from the emacs\r
74 interface.\r
75 \r
76 The test uses 4018 character long subject. This is the minimal\r
77 length to trigger the bug. I think the subject length should be\r
78 increased to a much higher value once the bug is fixed.\r
79 \r
80 The test is currently failing.\r
81 \r
82 The code is borrowed from the "Message with .. in Message-Id:"\r
83 test. Looks like this may be a common case for testing emacs\r
84 interface bugs with particular messages and should be moved to a\r
85 test-lib function.\r
86 \r
87 Regards,\r
88   Dmitry\r
89 \r
90 --=-=-=\r
91 Content-Type: text/x-diff\r
92 Content-Disposition: inline; filename=test-emacs-long-subject.patch\r
93 \r
94 commit f6892445d3212d49bcbfd2e50e6337c0a81eb26e\r
95 Author: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
96 Date:   Sun Nov 21 07:10:15 2010 +0300\r
97 \r
98     test: Add emacs test for messages with very long subjects\r
99     \r
100     Emacs search does not show messages with very long subjects. The\r
101     main notmuch view shows unread messages but nothing in the search\r
102     results. Thus you can not remove unread tag from the emacs\r
103     interface.\r
104     \r
105     The test uses 4018 character long subject. This is the minimal\r
106     length to trigger the bug. I think the subject length should be\r
107     increased to a much higher value once the bug is fixed.\r
108     \r
109     The test is currently failing.\r
110     \r
111     The code is borrowed from the "Message with .. in Message-Id:"\r
112     test. Looks like this may be a common case for testing emacs\r
113     interface bugs with particular messages and should be moved to a\r
114     test-lib function.\r
115 \r
116 diff --git a/test/emacs b/test/emacs\r
117 index 75dec89..52b7d0d 100755\r
118 --- a/test/emacs\r
119 +++ b/test/emacs\r
120 @@ -51,40 +51,47 @@ test_begin_subtest "Remove tag from search view"\r
121  test_emacs "(notmuch-search \"$os_x_darwin_thread\") (notmuch-test-wait) (notmuch-search-remove-tag \"tag-from-search-view\")"\r
122  output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
123  test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
124  \r
125  test_begin_subtest "Add tag from notmuch-show view"\r
126  test_emacs "(notmuch-show \"$os_x_darwin_thread\") (notmuch-show-add-tag \"tag-from-show-view\")"\r
127  output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
128  test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-show-view unread)"\r
129  \r
130  test_begin_subtest "Remove tag from notmuch-show view"\r
131  test_emacs "(notmuch-show \"$os_x_darwin_thread\") (notmuch-show-remove-tag \"tag-from-show-view\")"\r
132  output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
133  test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
134  \r
135  test_begin_subtest "Message with .. in Message-Id:"\r
136  add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'\r
137  test_emacs '(notmuch-search "id:\"123..456@example\"") (notmuch-test-wait) (notmuch-search-add-tag "search-add") (notmuch-search-add-tag "search-remove") (notmuch-search-remove-tag "search-remove") (notmuch-show "id:\"123..456@example\"") (notmuch-test-wait) (notmuch-show-add-tag "show-add") (notmuch-show-add-tag "show-remove") (notmuch-show-remove-tag "show-remove")'\r
138  output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize)\r
139  test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Message with .. in Message-Id (inbox search-add show-add)"\r
140  \r
141 +test_begin_subtest "Message with 4018 character long Subject:"\r
142 +subject=`for i in \`seq 4018\`; do echo -n a; done`\r
143 +add_message [id]=subject_4018@example [subject]=$subject\r
144 +test_emacs '(notmuch-search "id:\"subject_4018@example\"") (notmuch-test-wait) (notmuch-search-add-tag "search-add") (notmuch-search-add-tag "search-remove") (notmuch-search-remove-tag "search-remove") (notmuch-show "id:\"subject_4018@example\"") (notmuch-test-wait) (notmuch-show-add-tag "show-add") (notmuch-show-add-tag "show-remove") (notmuch-show-remove-tag "show-remove")'\r
145 +output=$(notmuch search 'id:"subject_4018@example"' | notmuch_search_sanitize)\r
146 +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; $subject (inbox search-add show-add)"\r
147 +\r
148  test_begin_subtest "Sending a message via (fake) SMTP"\r
149  \r
150  # Before we can send a message, we have to prepare the FCC maildir\r
151  mkdir -p mail/sent/cur\r
152  mkdir -p mail/sent/new\r
153  mkdir -p mail/sent/tmp\r
154  \r
155  ../smtp-dummy sent_message &\r
156  smtp_dummy_pid=$!\r
157  test_emacs "(setq message-send-mail-function 'message-smtpmail-send-it) (setq smtpmail-smtp-server \"localhost\") (setq smtpmail-smtp-service \"25025\") (notmuch-hello) (notmuch-mua-mail) (message-goto-to) (insert \"user@example.com\nDate: Fri, 29 Mar 1974 10:00:00 -0000\") (message-goto-subject) (insert \"Testing message sent via SMTP\") (message-goto-body) (insert \"This is a test that messages are sent via SMTP\") (message-send-and-exit)" >/dev/null 2>&1\r
158  wait ${smtp_dummy_pid}\r
159  \r
160  output=$(sed \\r
161      -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \\r
162      -e s',^Message-ID: <.*>$,Message-ID: <XXX>,' < sent_message)\r
163  test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
164  To: user@example.com\r
165  Subject: Testing message sent via SMTP\r
166  Date: Fri, 29 Mar 1974 10:00:00 -0000\r
167  User-Agent: Notmuch/XXX Emacs/XXX\r
168 \r
169 --=-=-=--\r