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 E5956431FC0 for ; Sun, 16 Dec 2012 00:17:55 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, 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 3z31WxizrwEI for ; Sun, 16 Dec 2012 00:17:55 -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 2ABB7431FB6 for ; Sun, 16 Dec 2012 00:17:55 -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 1Tk9Q1-000093-9A; Sun, 16 Dec 2012 08:17:53 +0000 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1Tk9Q0-0004nv-Us; Sun, 16 Dec 2012 08:17:53 +0000 From: Mark Walters To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH v2 3/4] test: notmuch search --format=text0 In-Reply-To: <5c881edb2803e613e8726f71fe86772d372b38a0.1355064714.git.jani@nikula.org> References: <5c881edb2803e613e8726f71fe86772d372b38a0.1355064714.git.jani@nikula.org> User-Agent: Notmuch/0.14+155~g7edfdc3 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Sun, 16 Dec 2012 08:17:56 +0000 Message-ID: <8738z6wguj.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Sender-Host-Address: 93.97.24.31 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: ab382be420668391e371ee7474e8f0e5 (of first 20000 bytes) X-SpamAssassin-Score: -1.8 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 -1.8 points. Summary of the scoring: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [138.37.6.40 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * 0.5 AWL AWL: From: address is in the auto white-list 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, 16 Dec 2012 08:17:56 -0000 On Sun, 09 Dec 2012, Jani Nikula wrote: > --- > test/text | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/test/text b/test/text > index 428c89b..e003a66 100755 > --- a/test/text > +++ b/test/text > @@ -52,4 +52,33 @@ output=3D$(notmuch search --format=3Dtext "t=C3=ABxt-s= earch-m=C3=A9ssage" | notmuch_search_s > test_expect_equal "$output" \ > "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; text-search-utf8-body= -s=C3=BCbj=C3=A9ct (inbox unread)" >=20=20 > +add_email_corpus > + > +test_begin_subtest "Search message tags: text0" > +cat < EXPECTED.$test_count > +attachment inbox signed unread > +EOF > +notmuch search --format=3Dtext0 --output=3Dtags '*' | xargs -0 | notmuch= _search_sanitize > OUTPUT.$test_count > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count > + > +test_begin_subtest "Compare text vs. text0 for threads" > +notmuch search --format=3Dtext --output=3Dthreads '*' | notmuch_search_s= anitize > EXPECTED.$test_count > +notmuch search --format=3Dtext0 --output=3Dthreads '*' | xargs -0 -L1 | = notmuch_search_sanitize > OUTPUT.$test_count > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count Hi These xargs -0 -L1 tests almost pass with format=3Dtext (no zero) passed: the output only differs in one newline at the end. Would it be worth strengthening the test at all? I don't have any good suggestion but replacing the xargs with tr '\n\0' ' \n' seemed to give clearly different output in the two cases (and the test passes as it stands). OTOH maybe the test before is sufficient in that respect. Best wishes Mark > + > +test_begin_subtest "Compare text vs. text0 for messages" > +notmuch search --format=3Dtext --output=3Dmessages '*' | notmuch_search_= sanitize > EXPECTED.$test_count > +notmuch search --format=3Dtext0 --output=3Dmessages '*' | xargs -0 -L1 |= notmuch_search_sanitize > OUTPUT.$test_count > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count > + > +test_begin_subtest "Compare text vs. text0 for files" > +notmuch search --format=3Dtext --output=3Dfiles '*' | notmuch_search_san= itize > EXPECTED.$test_count > +notmuch search --format=3Dtext0 --output=3Dfiles '*' | xargs -0 -L1 | no= tmuch_search_sanitize > OUTPUT.$test_count > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count > + > +test_begin_subtest "Compare text vs. text0 for tags" > +notmuch search --format=3Dtext --output=3Dtags '*' | notmuch_search_sani= tize > EXPECTED.$test_count > +notmuch search --format=3Dtext0 --output=3Dtags '*' | xargs -0 -L1 | not= much_search_sanitize > OUTPUT.$test_count > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count > + > test_done > --=20 > 1.7.10.4