[PATCH v2 08/14] cli/reply: reduce the reply format abstractions
[notmuch-archives.git] / 72 / ce61131061f6b5a027255c25966e6d3af668ea
1 Return-Path: <dme@dme.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 58F80421192\r
6         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 10:06:00 -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 aAqKMmD6Xodq for <notmuch@notmuchmail.org>;\r
16         Mon, 23 Jan 2012 10:05:59 -0800 (PST)\r
17 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
18         [74.125.82.181]) (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 4445C42119B\r
21         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 10:05:54 -0800 (PST)\r
22 Received: by werb10 with SMTP id b10so2714164wer.26\r
23         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 10:05:53 -0800 (PST)\r
24 Received: by 10.216.133.213 with SMTP id q63mr1744451wei.49.1327341952967;\r
25         Mon, 23 Jan 2012 10:05:52 -0800 (PST)\r
26 Received: from hotblack-desiato.hh.sledj.net\r
27         (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
28         by mx.google.com with ESMTPS id n3sm43507355wiz.9.2012.01.23.10.05.50\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Mon, 23 Jan 2012 10:05:51 -0800 (PST)\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
32         id F2684A0BB6; Mon, 23 Jan 2012 18:05:48 +0000 (GMT)\r
33 From: David Edmondson <dme@dme.org>\r
34 To: notmuch@notmuchmail.org\r
35 Subject: [PATCH 4/4 v42] test: Add address cleaning tests.\r
36 Date: Mon, 23 Jan 2012 18:05:47 +0000\r
37 Message-Id: <1327341947-29206-4-git-send-email-dme@dme.org>\r
38 X-Mailer: git-send-email 1.7.8.3\r
39 In-Reply-To: <1327341947-29206-1-git-send-email-dme@dme.org>\r
40 References: <1326804748-8989-2-git-send-email-dme@dme.org>\r
41         <1327341947-29206-1-git-send-email-dme@dme.org>\r
42 MIME-Version: 1.0\r
43 X-Gm-Message-State:\r
44  ALoCoQlZwDmLUSKsmUhCD9CGiWzpdh8WHm5sIjDOc8uDTukN77BAZE30kFljumakAcywwymgcJlZ\r
45 Content-Type: text/plain; charset=UTF-8\r
46 Content-Transfer-Encoding: 8bit\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Mon, 23 Jan 2012 18:06:00 -0000\r
60 \r
61 ---\r
62 \r
63 Anticipate the failure of test 3.\r
64 \r
65  test/emacs-address-cleaning.el |   29 +++++++++++++++++++++++++++++\r
66  test/emacs-address-cleaning.sh |   19 +++++++++++++++++++\r
67  test/notmuch-test              |    1 +\r
68  3 files changed, 49 insertions(+), 0 deletions(-)\r
69  create mode 100644 test/emacs-address-cleaning.el\r
70  create mode 100755 test/emacs-address-cleaning.sh\r
71 \r
72 diff --git a/test/emacs-address-cleaning.el b/test/emacs-address-cleaning.el\r
73 new file mode 100644\r
74 index 0000000..59e8d92\r
75 --- /dev/null\r
76 +++ b/test/emacs-address-cleaning.el\r
77 @@ -0,0 +1,29 @@\r
78 +(defun notmuch-test-address-cleaning-1 ()\r
79 +  (notmuch-test-compare (notmuch-show-clean-address "dme@dme.org")\r
80 +                       "dme@dme.org"))\r
81 +\r
82 +(defun notmuch-test-address-cleaning-2 ()\r
83 +  (let* ((input '("foo@bar.com"\r
84 +                 "<foo@bar.com>"\r
85 +                 "Foo Bar <foo@bar.com>"\r
86 +                 "foo@bar.com <foo@bar.com>"\r
87 +                 "\"Foo Bar\" <foo@bar.com>"))\r
88 +        (expected '("foo@bar.com"\r
89 +                    "foo@bar.com"\r
90 +                    "Foo Bar <foo@bar.com>"\r
91 +                    "foo@bar.com"\r
92 +                    "Foo Bar <foo@bar.com>"))\r
93 +        (output (mapcar #'notmuch-show-clean-address input)))\r
94 +    (notmuch-test-compare output expected)))\r
95 +\r
96 +(defun notmuch-test-address-cleaning-3 ()\r
97 +  (let* ((input '("ДБ <db-uknot@stop.me.uk>"\r
98 +                 "foo (at home) <foo@bar.com>"\r
99 +                 "foo [at home] <foo@bar.com>"\r
100 +                 "Foo Bar"))\r
101 +        (expected '("ДБ <db-uknot@stop.me.uk>"\r
102 +                    "foo (at home) <foo@bar.com>"\r
103 +                    "foo [at home] <foo@bar.com>"\r
104 +                    "Foo Bar"))\r
105 +        (output (mapcar #'notmuch-show-clean-address input)))\r
106 +    (notmuch-test-compare output expected)))\r
107 diff --git a/test/emacs-address-cleaning.sh b/test/emacs-address-cleaning.sh\r
108 new file mode 100755\r
109 index 0000000..0d85bdc\r
110 --- /dev/null\r
111 +++ b/test/emacs-address-cleaning.sh\r
112 @@ -0,0 +1,19 @@\r
113 +#!/usr/bin/env bash\r
114 +\r
115 +test_description="emacs address cleaning"\r
116 +. test-lib.sh\r
117 +\r
118 +test_begin_subtest "notmuch-test-address-clean part 1"\r
119 +test_emacs_expect_t \\r
120 +    '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-1)'\r
121 +\r
122 +test_begin_subtest "notmuch-test-address-clean part 2"\r
123 +test_emacs_expect_t \\r
124 +    '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-2)'\r
125 +\r
126 +test_begin_subtest "notmuch-test-address-clean part 3"\r
127 +test_subtest_known_broken\r
128 +test_emacs_expect_t \\r
129 +    '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-3)'\r
130 +\r
131 +test_done\r
132 diff --git a/test/notmuch-test b/test/notmuch-test\r
133 index d034f99..3f1740c 100755\r
134 --- a/test/notmuch-test\r
135 +++ b/test/notmuch-test\r
136 @@ -53,6 +53,7 @@ TESTS="\r
137    hooks\r
138    argument-parsing\r
139    emacs-test-functions.sh\r
140 +  emacs-address-cleaning.sh\r
141  "\r
142  TESTS=${NOTMUCH_TESTS:=$TESTS}\r
143  \r
144 -- \r
145 1.7.8.3\r
146 \r