From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 48DBF431FBF for ; Tue, 24 Jan 2012 07:36:17 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 e3mavVOwu9ut for ; Tue, 24 Jan 2012 07:36:16 -0800 (PST) Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 531B0431FB6 for ; Tue, 24 Jan 2012 07:36:16 -0800 (PST) Received: by bkbzt19 with SMTP id zt19so2483474bkb.26 for ; Tue, 24 Jan 2012 07:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type:content-transfer-encoding; bh=3Q4d+IaoJdxWVae51LLgjbFxEnpvsX62et6I9U9Q1tE=; b=b7e71gXuZpPPqaMWM++XCCbsI+mVmBQJcZeeuj0uHHZxbzG3wVinCbvc7dlakmnaS7 dmPAbsoI1IcdsYhVzw6ieGrP2NUZufwrgsqLvzbypuVpGIilKdxLPHc2zqMUjRooFkKE qWM0r4qkAJCF9RmOgw4KG7za2//8fPA6TAVxU= Received: by 10.205.129.20 with SMTP id hg20mr5306077bkc.77.1327419373251; Tue, 24 Jan 2012 07:36:13 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id ew13sm13431314bkb.1.2012.01.24.07.36.12 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jan 2012 07:36:12 -0800 (PST) From: Dmitry Kurochkin To: David Edmondson , notmuch@notmuchmail.org Subject: Re: [PATCH 4/4 v42] test: Add address cleaning tests. In-Reply-To: <1327341947-29206-4-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> <1327341947-29206-4-git-send-email-dme@dme.org> User-Agent: Notmuch/0.11+100~gd650abf (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Tue, 24 Jan 2012 19:35:06 +0400 Message-ID: <87boptm7v9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Tue, 24 Jan 2012 15:36:17 -0000 On Mon, 23 Jan 2012 18:05:47 +0000, David Edmondson wrote: > --- >=20 > Anticipate the failure of test 3. >=20 LGTM Regards, Dmitry > 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 >=20 > 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 '("=D0=94=D0=91 " > + "foo (at home) " > + "foo [at home] " > + "Foo Bar")) > + (expected '("=D0=94=D0=91 " > + "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=3D"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=3D" > hooks > argument-parsing > emacs-test-functions.sh > + emacs-address-cleaning.sh > " > TESTS=3D${NOTMUCH_TESTS:=3D$TESTS} >=20=20 > --=20 > 1.7.8.3 >=20 > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch