[PATCH 1/3] test: Add tests for `notmuch-show-clean-address'.
authorDavid Edmondson <dme@dme.org>
Tue, 27 Dec 2011 10:15:38 +0000 (10:15 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:41:19 +0000 (09:41 -0800)
ab/591db5ec67897e2349817fe23b815ea538e5bc [new file with mode: 0644]

diff --git a/ab/591db5ec67897e2349817fe23b815ea538e5bc b/ab/591db5ec67897e2349817fe23b815ea538e5bc
new file mode 100644 (file)
index 0000000..f6fbbe0
--- /dev/null
@@ -0,0 +1,112 @@
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id D6793431FD0\r
+       for <notmuch@notmuchmail.org>; Tue, 27 Dec 2011 02:15:46 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id kpO7-J0jrBcx for <notmuch@notmuchmail.org>;\r
+       Tue, 27 Dec 2011 02:15:46 -0800 (PST)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+       [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id C5C54431FB6\r
+       for <notmuch@notmuchmail.org>; Tue, 27 Dec 2011 02:15:45 -0800 (PST)\r
+Received: by wibhq2 with SMTP id hq2so5887214wib.26\r
+       for <notmuch@notmuchmail.org>; Tue, 27 Dec 2011 02:15:44 -0800 (PST)\r
+Received: by 10.180.19.74 with SMTP id c10mr60079321wie.8.1324980944670;\r
+       Tue, 27 Dec 2011 02:15:44 -0800 (PST)\r
+Received: from hotblack-desiato.hh.sledj.net\r
+       (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
+       by mx.google.com with ESMTPS id dj9sm64328327wib.6.2011.12.27.02.15.42\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 27 Dec 2011 02:15:43 -0800 (PST)\r
+Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
+       id 4FA42A04BC; Tue, 27 Dec 2011 10:15:41 +0000 (GMT)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/3] test: Add tests for `notmuch-show-clean-address'.\r
+Date: Tue, 27 Dec 2011 10:15:38 +0000\r
+Message-Id: <1324980940-25466-1-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 1.7.7.3\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 27 Dec 2011 10:15:47 -0000\r
+\r
+---\r
+\r
+The address containing UTF-8 still fails. This looks like a failure to\r
+properly round-trip UTF-8 in the test suite - the test passes if run\r
+directly within emacs.\r
+\r
+ test/emacs                                         |   19 +++++++++++++++++++\r
+ .../notmuch-address-simplification                 |    9 +++++++++\r
+ 2 files changed, 28 insertions(+), 0 deletions(-)\r
+ create mode 100644 test/emacs.expected-output/notmuch-address-simplification\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index ca82445..bb4a75f 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -514,4 +514,23 @@ counter=$(test_emacs \\r
+ )\r
+ test_expect_equal "$counter" 2\r
\r
++test_begin_subtest "notmuch-show address simplification"\r
++test_emacs '\r
++(with-temp-buffer\r
++  (let ((input (list\r
++"foo@bar.com"\r
++"<foo@bar.com>"\r
++"Foo Bar <foo@bar.com>"\r
++"foo@bar.com <foo@bar.com>"\r
++"ДБ <db-uknot@stop.me.uk>"\r
++"foo (at home) <foo@bar.com>"\r
++"foo [at home] <foo@bar.com>"\r
++"\"Foo Bar\" <foo@bar.com>"\r
++"Foo Bar"\r
++              )))\r
++    (mapc (lambda (a) (insert (notmuch-show-clean-address a) "\n")) input))\r
++  (test-output))\r
++'\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-address-simplification\r
++\r
+ test_done\r
+diff --git a/test/emacs.expected-output/notmuch-address-simplification b/test/emacs.expected-output/notmuch-address-simplification\r
+new file mode 100644\r
+index 0000000..0afe190\r
+--- /dev/null\r
++++ b/test/emacs.expected-output/notmuch-address-simplification\r
+@@ -0,0 +1,9 @@\r
++foo@bar.com\r
++foo@bar.com\r
++Foo Bar <foo@bar.com>\r
++foo@bar.com\r
++ДБ <db-uknot@stop.me.uk>\r
++foo (at home) <foo@bar.com>\r
++foo [at home] <foo@bar.com>\r
++Foo Bar <foo@bar.com>\r
++Foo Bar\r
+-- \r
+1.7.7.3\r
+\r