Re: [PATCH 4/4 v42] test: Add address cleaning tests.
[notmuch-archives.git] / 50 / cdb1cbac2c29c81fac6b48ff392041164d5334
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 48DBF431FBF\r
6         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 07:36:17 -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.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id e3mavVOwu9ut for <notmuch@notmuchmail.org>;\r
17         Tue, 24 Jan 2012 07:36:16 -0800 (PST)\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 531B0431FB6\r
22         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 07:36:16 -0800 (PST)\r
23 Received: by bkbzt19 with SMTP id zt19so2483474bkb.26\r
24         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 07:36:15 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\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         bh=3Q4d+IaoJdxWVae51LLgjbFxEnpvsX62et6I9U9Q1tE=;\r
29         b=b7e71gXuZpPPqaMWM++XCCbsI+mVmBQJcZeeuj0uHHZxbzG3wVinCbvc7dlakmnaS7\r
30         dmPAbsoI1IcdsYhVzw6ieGrP2NUZufwrgsqLvzbypuVpGIilKdxLPHc2zqMUjRooFkKE\r
31         qWM0r4qkAJCF9RmOgw4KG7za2//8fPA6TAVxU=\r
32 Received: by 10.205.129.20 with SMTP id hg20mr5306077bkc.77.1327419373251;\r
33         Tue, 24 Jan 2012 07:36:13 -0800 (PST)\r
34 Received: from localhost ([91.144.186.21])\r
35         by mx.google.com with ESMTPS id ew13sm13431314bkb.1.2012.01.24.07.36.12\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Tue, 24 Jan 2012 07:36:12 -0800 (PST)\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
39 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
40 Subject: Re: [PATCH 4/4 v42] test: Add address cleaning tests.\r
41 In-Reply-To: <1327341947-29206-4-git-send-email-dme@dme.org>\r
42 References: <1326804748-8989-2-git-send-email-dme@dme.org>\r
43         <1327341947-29206-1-git-send-email-dme@dme.org>\r
44         <1327341947-29206-4-git-send-email-dme@dme.org>\r
45 User-Agent: Notmuch/0.11+100~gd650abf (http://notmuchmail.org) Emacs/23.3.1\r
46         (x86_64-pc-linux-gnu)\r
47 Date: Tue, 24 Jan 2012 19:35:06 +0400\r
48 Message-ID: <87boptm7v9.fsf@gmail.com>\r
49 MIME-Version: 1.0\r
50 Content-Type: text/plain; charset=utf-8\r
51 Content-Transfer-Encoding: quoted-printable\r
52 X-BeenThere: notmuch@notmuchmail.org\r
53 X-Mailman-Version: 2.1.13\r
54 Precedence: list\r
55 List-Id: "Use and development of the notmuch mail system."\r
56         <notmuch.notmuchmail.org>\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
60 List-Post: <mailto:notmuch@notmuchmail.org>\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
64 X-List-Received-Date: Tue, 24 Jan 2012 15:36:17 -0000\r
65 \r
66 On Mon, 23 Jan 2012 18:05:47 +0000, David Edmondson <dme@dme.org> wrote:\r
67 > ---\r
68 >=20\r
69 > Anticipate the failure of test 3.\r
70 >=20\r
71 \r
72 LGTM\r
73 \r
74 Regards,\r
75   Dmitry\r
76 \r
77 >  test/emacs-address-cleaning.el |   29 +++++++++++++++++++++++++++++\r
78 >  test/emacs-address-cleaning.sh |   19 +++++++++++++++++++\r
79 >  test/notmuch-test              |    1 +\r
80 >  3 files changed, 49 insertions(+), 0 deletions(-)\r
81 >  create mode 100644 test/emacs-address-cleaning.el\r
82 >  create mode 100755 test/emacs-address-cleaning.sh\r
83 >=20\r
84 > diff --git a/test/emacs-address-cleaning.el b/test/emacs-address-cleaning=\r
85 .el\r
86 > new file mode 100644\r
87 > index 0000000..59e8d92\r
88 > --- /dev/null\r
89 > +++ b/test/emacs-address-cleaning.el\r
90 > @@ -0,0 +1,29 @@\r
91 > +(defun notmuch-test-address-cleaning-1 ()\r
92 > +  (notmuch-test-compare (notmuch-show-clean-address "dme@dme.org")\r
93 > +                     "dme@dme.org"))\r
94 > +\r
95 > +(defun notmuch-test-address-cleaning-2 ()\r
96 > +  (let* ((input '("foo@bar.com"\r
97 > +               "<foo@bar.com>"\r
98 > +               "Foo Bar <foo@bar.com>"\r
99 > +               "foo@bar.com <foo@bar.com>"\r
100 > +               "\"Foo Bar\" <foo@bar.com>"))\r
101 > +      (expected '("foo@bar.com"\r
102 > +                  "foo@bar.com"\r
103 > +                  "Foo Bar <foo@bar.com>"\r
104 > +                  "foo@bar.com"\r
105 > +                  "Foo Bar <foo@bar.com>"))\r
106 > +      (output (mapcar #'notmuch-show-clean-address input)))\r
107 > +    (notmuch-test-compare output expected)))\r
108 > +\r
109 > +(defun notmuch-test-address-cleaning-3 ()\r
110 > +  (let* ((input '("=D0=94=D0=91 <db-uknot@stop.me.uk>"\r
111 > +               "foo (at home) <foo@bar.com>"\r
112 > +               "foo [at home] <foo@bar.com>"\r
113 > +               "Foo Bar"))\r
114 > +      (expected '("=D0=94=D0=91 <db-uknot@stop.me.uk>"\r
115 > +                  "foo (at home) <foo@bar.com>"\r
116 > +                  "foo [at home] <foo@bar.com>"\r
117 > +                  "Foo Bar"))\r
118 > +      (output (mapcar #'notmuch-show-clean-address input)))\r
119 > +    (notmuch-test-compare output expected)))\r
120 > diff --git a/test/emacs-address-cleaning.sh b/test/emacs-address-cleaning=\r
121 .sh\r
122 > new file mode 100755\r
123 > index 0000000..0d85bdc\r
124 > --- /dev/null\r
125 > +++ b/test/emacs-address-cleaning.sh\r
126 > @@ -0,0 +1,19 @@\r
127 > +#!/usr/bin/env bash\r
128 > +\r
129 > +test_description=3D"emacs address cleaning"\r
130 > +. test-lib.sh\r
131 > +\r
132 > +test_begin_subtest "notmuch-test-address-clean part 1"\r
133 > +test_emacs_expect_t \\r
134 > +    '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-1=\r
135 )'\r
136 > +\r
137 > +test_begin_subtest "notmuch-test-address-clean part 2"\r
138 > +test_emacs_expect_t \\r
139 > +    '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-2=\r
140 )'\r
141 > +\r
142 > +test_begin_subtest "notmuch-test-address-clean part 3"\r
143 > +test_subtest_known_broken\r
144 > +test_emacs_expect_t \\r
145 > +    '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-3=\r
146 )'\r
147 > +\r
148 > +test_done\r
149 > diff --git a/test/notmuch-test b/test/notmuch-test\r
150 > index d034f99..3f1740c 100755\r
151 > --- a/test/notmuch-test\r
152 > +++ b/test/notmuch-test\r
153 > @@ -53,6 +53,7 @@ TESTS=3D"\r
154 >    hooks\r
155 >    argument-parsing\r
156 >    emacs-test-functions.sh\r
157 > +  emacs-address-cleaning.sh\r
158 >  "\r
159 >  TESTS=3D${NOTMUCH_TESTS:=3D$TESTS}\r
160 >=20=20\r
161 > --=20\r
162 > 1.7.8.3\r
163 >=20\r
164 > _______________________________________________\r
165 > notmuch mailing list\r
166 > notmuch@notmuchmail.org\r
167 > http://notmuchmail.org/mailman/listinfo/notmuch\r