From: Mark Walters Date: Sun, 18 Jan 2015 18:12:13 +0000 (+0000) Subject: Re: [PATCH v2 3/3] test: Update tests for 'authors_matched' and authors_non_matched'. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c62219afdab9ade9fddae6871b1af9fb790af959;p=notmuch-archives.git Re: [PATCH v2 3/3] test: Update tests for 'authors_matched' and authors_non_matched'. --- diff --git a/01/cc62e63a7c39f7b74b6d4c072e7ef169e08c3e b/01/cc62e63a7c39f7b74b6d4c072e7ef169e08c3e new file mode 100644 index 000000000..c960ca379 --- /dev/null +++ b/01/cc62e63a7c39f7b74b6d4c072e7ef169e08c3e @@ -0,0 +1,201 @@ +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 A1976431FC2 + for ; Sun, 18 Jan 2015 10:11:59 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 1.34 +X-Spam-Level: * +X-Spam-Status: No, score=1.34 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, DNS_FROM_AHBL_RHSBL=2.438, + FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] + 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 uegCrfMIGDPF for ; + Sun, 18 Jan 2015 10:11:56 -0800 (PST) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 36D82431FAF + for ; Sun, 18 Jan 2015 10:11:56 -0800 (PST) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1YCuKI-0006P2-7y; Sun, 18 Jan 2015 18:11:54 +0000 +Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1YCuKH-00079q-Rw; Sun, 18 Jan 2015 18:11:54 +0000 +From: Mark Walters +To: David Edmondson , notmuch@notmuchmail.org +Subject: Re: [PATCH v2 3/3] test: Update tests for 'authors_matched' + and authors_non_matched'. +In-Reply-To: <1414172643-28270-4-git-send-email-dme@dme.org> +References: <1414172643-28270-1-git-send-email-dme@dme.org> + <1414172643-28270-4-git-send-email-dme@dme.org> +User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-pc-linux-gnu) +Date: Sun, 18 Jan 2015 18:12:13 +0000 +Message-ID: <87lhl0j6v6.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable +X-Sender-Host-Address: 87.81.223.162 +X-QM-Geographic: According to ripencc, + this message was delivered by a machine in Britain (UK) (GB). +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: 00fd39bf4b9b2d8345d0d89e2b43fc21 (of first 20000 bytes) +X-SpamAssassin-Score: -0.1 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -0.1 points. + Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay + * domain + * -0.1 AWL AWL: Adjusted score from AWL reputation of From: address +X-QM-Scan-Virus: ClamAV says the message is clean +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: Sun, 18 Jan 2015 18:11:59 -0000 + + +Hi + +Only one small comment here: it would be nice to have a test that has a +non-empty authors_non_matched field. + +Best wishes + +Mark + +On Fri, 24 Oct 2014, David Edmondson wrote: +> --- +> test/T160-json.sh | 9 +++++++++ +> test/T170-sexp.sh | 4 ++-- +> test/T470-missing-headers.sh | 8 ++++++++ +> 3 files changed, 19 insertions(+), 2 deletions(-) +> +> diff --git a/test/T160-json.sh b/test/T160-json.sh +> index c1cf649..0a8df18 100755 +> --- a/test/T160-json.sh +> +++ b/test/T160-json.sh +> @@ -25,6 +25,10 @@ test_expect_equal_json "$output" "[{\"thread\": \"XXX\= +", +> \"matched\": 1, +> \"total\": 1, +> \"authors\": \"Notmuch Test Suite\", +> + \"authors_matched\": [ +> + \"Notmuch Test Suite\" +> + ], +> + \"authors_non_matched\": [], +> \"subject\": \"json-search-subject\", +> \"query\": [\"id:$gen_msg_id\", null], +> \"tags\": [\"inbox\", +> @@ -59,6 +63,11 @@ test_expect_equal_json "$output" "[{\"thread\": \"XXX\= +", +> \"matched\": 1, +> \"total\": 1, +> \"authors\": \"Notmuch Test Suite\", +> + \"authors\": \"Notmuch Test Suite\", +> + \"authors_matched\": [ +> + \"Notmuch Test Suite\" +> + ], +> + \"authors_non_matched\": [], +> \"subject\": \"json-search-utf8-body-s=C3=BCbj=C3=A9ct\", +> \"query\": [\"id:$gen_msg_id\", null], +> \"tags\": [\"inbox\", +> diff --git a/test/T170-sexp.sh b/test/T170-sexp.sh +> index 667e319..f2a08bf 100755 +> --- a/test/T170-sexp.sh +> +++ b/test/T170-sexp.sh +> @@ -19,7 +19,7 @@ test_expect_equal "$output" "((((:id \"${gen_msg_id}\" = +:match t :excluded nil :f +> test_begin_subtest "Search message: sexp" +> add_message "[subject]=3D\"sexp-search-subject\"" "[date]=3D\"Sat, 01 Ja= +n 2000 12:00:00 -0000\"" "[body]=3D\"sexp-search-message\"" +> output=3D$(notmuch search --format=3Dsexp "sexp-search-message" | notmuc= +h_search_sanitize) +> -test_expect_equal "$output" "((:thread \"0000000000000002\" :timestamp 9= +46728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmu= +ch Test Suite\" :subject \"sexp-search-subject\" :query (\"id:$gen_msg_id\"= + nil) :tags (\"inbox\" \"unread\")))" +> +test_expect_equal "$output" "((:thread \"0000000000000002\" :timestamp 9= +46728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmu= +ch Test Suite\" :authors_matched (\"Notmuch Test Suite\") :authors_non_matc= +hed () :subject \"sexp-search-subject\" :query (\"id:$gen_msg_id\" nil) :ta= +gs (\"inbox\" \"unread\")))" +>=20=20 +> test_begin_subtest "Show message: sexp, utf-8" +> add_message "[subject]=3D\"sexp-show-utf8-body-s=C3=BCbj=C3=A9ct\"" "[da= +te]=3D\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=3D\"js=C3=B6n-show-m=C3= +=A9ssage\"" +> @@ -44,7 +44,7 @@ test_expect_equal "$output" "((((:id \"$id\" :match t := +excluded nil :filename \" +> test_begin_subtest "Search message: sexp, utf-8" +> add_message "[subject]=3D\"sexp-search-utf8-body-s=C3=BCbj=C3=A9ct\"" "[= +date]=3D\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=3D\"js=C3=B6n-search-m= +=C3=A9ssage\"" +> output=3D$(notmuch search --format=3Dsexp "js=C3=B6n-search-m=C3=A9ssage= +" | notmuch_search_sanitize) +> -test_expect_equal "$output" "((:thread \"0000000000000005\" :timestamp 9= +46728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmu= +ch Test Suite\" :subject \"sexp-search-utf8-body-s=C3=BCbj=C3=A9ct\" :query= + (\"id:$gen_msg_id\" nil) :tags (\"inbox\" \"unread\")))" +> +test_expect_equal "$output" "((:thread \"0000000000000005\" :timestamp 9= +46728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmu= +ch Test Suite\" :authors_matched (\"Notmuch Test Suite\") :authors_non_matc= +hed () :subject \"sexp-search-utf8-body-s=C3=BCbj=C3=A9ct\" :query (\"id:$g= +en_msg_id\" nil) :tags (\"inbox\" \"unread\")))" +>=20=20 +>=20=20 +> test_done +> diff --git a/test/T470-missing-headers.sh b/test/T470-missing-headers.sh +> index cb38301..250a370 100755 +> --- a/test/T470-missing-headers.sh +> +++ b/test/T470-missing-headers.sh +> @@ -34,6 +34,10 @@ test_expect_equal_json "$output" ' +> [ +> { +> "authors": "", +> + "authors_matched": [ +> + "" +> + ], +> + "authors_non_matched": [], +> "date_relative": "2001-01-05", +> "matched": 1, +> "subject": "", +> @@ -48,6 +52,10 @@ test_expect_equal_json "$output" ' +> }, +> { +> "authors": "Notmuch Test Suite", +> + "authors_matched": [ +> + "Notmuch Test Suite" +> + ], +> + "authors_non_matched": [], +> "date_relative": "1970-01-01", +> "matched": 1, +> "subject": "", +> --=20 +> 2.1.1 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch