Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 58F80421192 for ; Mon, 23 Jan 2012 10:06:00 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aAqKMmD6Xodq for ; Mon, 23 Jan 2012 10:05:59 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 4445C42119B for ; Mon, 23 Jan 2012 10:05:54 -0800 (PST) Received: by werb10 with SMTP id b10so2714164wer.26 for ; Mon, 23 Jan 2012 10:05:53 -0800 (PST) Received: by 10.216.133.213 with SMTP id q63mr1744451wei.49.1327341952967; Mon, 23 Jan 2012 10:05:52 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id n3sm43507355wiz.9.2012.01.23.10.05.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Jan 2012 10:05:51 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id F2684A0BB6; Mon, 23 Jan 2012 18:05:48 +0000 (GMT) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH 4/4 v42] test: Add address cleaning tests. Date: Mon, 23 Jan 2012 18:05:47 +0000 Message-Id: <1327341947-29206-4-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1327341947-29206-1-git-send-email-dme@dme.org> References: <1326804748-8989-2-git-send-email-dme@dme.org> <1327341947-29206-1-git-send-email-dme@dme.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlZwDmLUSKsmUhCD9CGiWzpdh8WHm5sIjDOc8uDTukN77BAZE30kFljumakAcywwymgcJlZ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 18:06:00 -0000 --- Anticipate the failure of test 3. test/emacs-address-cleaning.el | 29 +++++++++++++++++++++++++++++ test/emacs-address-cleaning.sh | 19 +++++++++++++++++++ test/notmuch-test | 1 + 3 files changed, 49 insertions(+), 0 deletions(-) create mode 100644 test/emacs-address-cleaning.el create mode 100755 test/emacs-address-cleaning.sh diff --git a/test/emacs-address-cleaning.el b/test/emacs-address-cleaning.el new file mode 100644 index 0000000..59e8d92 --- /dev/null +++ b/test/emacs-address-cleaning.el @@ -0,0 +1,29 @@ +(defun notmuch-test-address-cleaning-1 () + (notmuch-test-compare (notmuch-show-clean-address "dme@dme.org") + "dme@dme.org")) + +(defun notmuch-test-address-cleaning-2 () + (let* ((input '("foo@bar.com" + "" + "Foo Bar " + "foo@bar.com " + "\"Foo Bar\" ")) + (expected '("foo@bar.com" + "foo@bar.com" + "Foo Bar " + "foo@bar.com" + "Foo Bar ")) + (output (mapcar #'notmuch-show-clean-address input))) + (notmuch-test-compare output expected))) + +(defun notmuch-test-address-cleaning-3 () + (let* ((input '("ДБ " + "foo (at home) " + "foo [at home] " + "Foo Bar")) + (expected '("ДБ " + "foo (at home) " + "foo [at home] " + "Foo Bar")) + (output (mapcar #'notmuch-show-clean-address input))) + (notmuch-test-compare output expected))) diff --git a/test/emacs-address-cleaning.sh b/test/emacs-address-cleaning.sh new file mode 100755 index 0000000..0d85bdc --- /dev/null +++ b/test/emacs-address-cleaning.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +test_description="emacs address cleaning" +. test-lib.sh + +test_begin_subtest "notmuch-test-address-clean part 1" +test_emacs_expect_t \ + '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-1)' + +test_begin_subtest "notmuch-test-address-clean part 2" +test_emacs_expect_t \ + '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-2)' + +test_begin_subtest "notmuch-test-address-clean part 3" +test_subtest_known_broken +test_emacs_expect_t \ + '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-3)' + +test_done diff --git a/test/notmuch-test b/test/notmuch-test index d034f99..3f1740c 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -53,6 +53,7 @@ TESTS=" hooks argument-parsing emacs-test-functions.sh + emacs-address-cleaning.sh " TESTS=${NOTMUCH_TESTS:=$TESTS} -- 1.7.8.3