[feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / a5 / bad9e4e5d3c9392d93ac88a1b26f5f1185433e
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 64624431FDE\r
6         for <notmuch@notmuchmail.org>; Thu, 15 Nov 2012 11:50:19 -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 c6NZgjrbi5Ro for <notmuch@notmuchmail.org>;\r
16         Thu, 15 Nov 2012 11:50:17 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU\r
18         [18.7.68.35])\r
19         by olra.theworths.org (Postfix) with ESMTP id 03182431FC4\r
20         for <notmuch@notmuchmail.org>; Thu, 15 Nov 2012 11:50:12 -0800 (PST)\r
21 X-AuditID: 12074423-b7fab6d0000008f9-76-50a54774e2fa\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
23         by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 3B.ED.02297.47745A05; Thu, 15 Nov 2012 14:50:12 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id qAFJo1Up005191; \r
27         Thu, 15 Nov 2012 14:50:01 -0500\r
28 Received: from drake.dyndns.org (26-4-172.dynamic.csail.mit.edu [18.26.4.172])\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 qAFJnuZ3018786\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Thu, 15 Nov 2012 14:49:59 -0500 (EST)\r
34 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1TZ5Rk-0004YA-Mn; Thu, 15 Nov 2012 14:49:56 -0500\r
37 From: Austin Clements <amdragon@MIT.EDU>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v3 1/3] test: Test buttonization of id: links\r
40 Date: Thu, 15 Nov 2012 14:49:52 -0500\r
41 Message-Id: <1353008994-17305-2-git-send-email-amdragon@mit.edu>\r
42 X-Mailer: git-send-email 1.7.10.4\r
43 In-Reply-To: <1353008994-17305-1-git-send-email-amdragon@mit.edu>\r
44 References: <1353008994-17305-1-git-send-email-amdragon@mit.edu>\r
45 X-Brightmail-Tracker:\r
46  H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsUixCmqrVvivjTA4OQlJYvrN2cyW7xZOY/V\r
47         gcnj8NeFLB7PVt1iDmCK4rJJSc3JLEst0rdL4MpY2LqAtWCFaMXBOXNZGhjfC3YxcnBICJhI\r
48         tE2u62LkBDLFJC7cW8/WxcjFISSwj1Fi3euH7BDOBkaJc787WCCcU0wS1//sg3LmMkpcmbya\r
49         FaSfTUBDYtv+5YwgtoiAtMTOu7PB4swCVhKHr25iBVknLGArse9oEojJIqAqceaBE0gFr4CD\r
50         xJOjDYwQVyhKdD+bwAZicwo4Shy5NBPMFgKquffxLtsERv4FjAyrGGVTcqt0cxMzc4pTk3WL\r
51         kxPz8lKLdM30cjNL9FJTSjcxgsKI3UV5B+Ofg0qHGAU4GJV4eE/cXBwgxJpYVlyZe4hRkoNJ\r
52         SZQ30WZpgBBfUn5KZUZicUZ8UWlOavEhRgkOZiURXk85oBxvSmJlVWpRPkxKmoNFSZz3WspN\r
53         fyGB9MSS1OzU1ILUIpisDAeHkgRvrRtQo2BRanpqRVpmTglCmomDE2Q4D9BwB5Aa3uKCxNzi\r
54         zHSI/ClGRSlxXk+QhABIIqM0D64XFuevGMWBXhHmjQWp4gGmCLjuV0CDmYAGb5FZAjK4JBEh\r
55         JdXAyKlk4hPILLLkWLD3vSkxfyv5dvl8LTy6VW51aEP7TLUHB7fs3218sXx/fniyxPvi0FM8\r
56         116/Pf/t+3vrv3elhauFnFMl3T9WCP5Qt99SZ+3lseGW2ZlX3oYXv1W4ZU28/OnZp4d7j6yf\r
57         pl1/kDeybcm74nWPTRg43icv+bFgTdDV0IaEl0qhE5VYijMSDbWYi4oTAaSKJcrOAgAA\r
58 Cc: tomi.ollila@iki.fi\r
59 X-BeenThere: notmuch@notmuchmail.org\r
60 X-Mailman-Version: 2.1.13\r
61 Precedence: list\r
62 List-Id: "Use and development of the notmuch mail system."\r
63         <notmuch.notmuchmail.org>\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
67 List-Post: <mailto:notmuch@notmuchmail.org>\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
71 X-List-Received-Date: Thu, 15 Nov 2012 19:50:19 -0000\r
72 \r
73 This matches the current behavior of the buttonizer, so it passes, but\r
74 many of these cases are not what you'd want (and some of them aren't\r
75 even valid Xapian queries).  The next patch will fix the handling of\r
76 these cases and update the test.\r
77 ---\r
78  test/emacs-show  |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++\r
79  test/test-lib.el |   14 ++++++++++++++\r
80  2 files changed, 64 insertions(+)\r
81 \r
82 diff --git a/test/emacs-show b/test/emacs-show\r
83 index 64c38d3..5d7151b 100755\r
84 --- a/test/emacs-show\r
85 +++ b/test/emacs-show\r
86 @@ -106,5 +106,55 @@ test_emacs '(notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir st\r
87         (test-visible-output)'\r
88  test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-indent-thread-content-off\r
89  \r
90 +test_begin_subtest "id buttonization"\r
91 +add_message '[body]="\r
92 +id:abc\r
93 +id:abc.def. id:abc,def, id:abc;def; id:abc:def:\r
94 +id:foo@bar.?baz? id:foo@bar!.baz!\r
95 +(id:foo@bar.baz) [id:foo@bar.baz]\r
96 +id:foo@bar.baz...\r
97 +id:2+2=5\r
98 +id:=_-:/.[]@$%+\r
99 +id:abc)def\r
100 +id:ab\"c def\r
101 +id:\"abc\"def\r
102 +id:\"ab\"\"c\"def\r
103 +id:\"ab c\"def\r
104 +id:\"abc\".def\r
105 +id:\"abc\r
106 +\"\r
107 +id:)\r
108 +id:\r
109 +cid:xxx"'\r
110 +test_emacs '(notmuch-show "id:'$gen_msg_id'")\r
111 +       (notmuch-test-mark-links)\r
112 +       (test-visible-output)'\r
113 +cat <<EOF >EXPECTED\r
114 +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)\r
115 +Subject: id buttonization\r
116 +To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
117 +Date: Fri, 05 Jan 2001 15:43:57 +0000\r
118 +\r
119 +<<id:abc>>\r
120 +<<id:abc.def.>> <<id:abc,def,>> <<id:abc;def;>> <<id:abc:def:>>\r
121 +<<id:foo@bar.?baz?>> <<id:foo@bar!.baz!>>\r
122 +(<<id:foo@bar.baz)>> [<<id:foo@bar.baz]>>\r
123 +<<id:foo@bar.baz...>>\r
124 +<<id:2+2=5>>\r
125 +<<id:=_-:/.[]@$%+>>\r
126 +<<id:abc)def>>\r
127 +<<id:ab>>"c def\r
128 +<<id:"abc">>def\r
129 +<<id:"ab">>"c"def\r
130 +id:"ab c"def\r
131 +<<id:"abc">>.def\r
132 +id:"abc\r
133 +"\r
134 +<<id:)>>\r
135 +id:\r
136 +c<<id:xxx>>\r
137 +EOF\r
138 +test_expect_equal_file OUTPUT EXPECTED\r
139 +\r
140  \r
141  test_done\r
142 diff --git a/test/test-lib.el b/test/test-lib.el\r
143 index fa3380c..dece811 100644\r
144 --- a/test/test-lib.el\r
145 +++ b/test/test-lib.el\r
146 @@ -107,6 +107,20 @@ nothing."\r
147                (ad-set-arg 1 (char-to-string char))\r
148                ad-do-it))))\r
149  \r
150 +(defun notmuch-test-mark-links ()\r
151 +  "Enclose links in the current buffer with << and >>."\r
152 +  ;; Links are often created by jit-lock functions\r
153 +  (jit-lock-fontify-now)\r
154 +  (save-excursion\r
155 +    (let ((inhibit-read-only t))\r
156 +      (goto-char (point-min))\r
157 +      (let ((button))\r
158 +       (while (setq button (next-button (point)))\r
159 +         (goto-char (button-start button))\r
160 +         (insert "<<")\r
161 +         (goto-char (button-end button))\r
162 +         (insert ">>"))))))\r
163 +\r
164  (defmacro notmuch-test-run (&rest body)\r
165    "Evaluate a BODY of test expressions and output the result."\r
166    `(with-temp-buffer\r
167 -- \r
168 1.7.10.4\r
169 \r