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 BD0E0431FAF for ; Sat, 8 Dec 2012 09:54:33 -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 9-0HM-07Q0RY for ; Sat, 8 Dec 2012 09:54:33 -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 03C42431FAE for ; Sat, 8 Dec 2012 09:54:32 -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 1ThOba-00038I-32; Sat, 08 Dec 2012 17:54:28 +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 1ThObZ-0006ra-PV; Sat, 08 Dec 2012 17:54:25 +0000 From: Mark Walters To: david@tethera.net, notmuch@notmuchmail.org Subject: Re: [Patch v4 08/10] test/dump-restore: add test for warning/error messages In-Reply-To: <1354979276-20099-9-git-send-email-david@tethera.net> References: <1354979276-20099-1-git-send-email-david@tethera.net> <1354979276-20099-9-git-send-email-david@tethera.net> User-Agent: Notmuch/0.14+155~g7edfdc3 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Sat, 08 Dec 2012 17:54:30 +0000 Message-ID: <87r4n0a0q1.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 93.97.24.31 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 9d67292a84f15ad19fa6cab86099a571 (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 Cc: David Bremner 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: Sat, 08 Dec 2012 17:54:33 -0000 On Sat, 08 Dec 2012, david@tethera.net wrote: > From: David Bremner > > We want to test both that error/warning messages are generated when > they should be, and not generated when they should not be. This varies > between restore and batch tagging. > --- > test/dump-restore | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/test/dump-restore b/test/dump-restore > index 7d91cca..b267792 100755 > --- a/test/dump-restore > +++ b/test/dump-restore > @@ -181,6 +181,35 @@ notmuch restore < EXPECTED.$test_count > notmuch dump --format=sup > OUTPUT.$test_count > test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count > > +test_begin_subtest 'restore: checking error messages' > +notmuch restore <OUTPUT > ++a +b > ++c +d -- > +# this is a harmless comment, do not yell about it. > + > +# the previous line was blank; also no yelling please > ++%zz -- id:whatever > ++e +f id:%yy > +# the next line should report an an empty tag error for batch tagging, but restore > ++ +e -- id:20091117232137.GA7669@griffis1.net I don't follow the comment above: do you mean "but not for restore", or it should report an error but restore anyway or? Best wishes Mark > +# highlight the sketchy id parsing; this should be last > ++g -- id:foo and bar > +EOF > + > +cat < EXPECTED > +Warning: no query string: +a +b > +Warning: Ignoring invalid input line +a +b > +Warning: no query string: +c +d -- > +Warning: Ignoring invalid input line +c +d -- > +Warning: Hex decoding of tag %zz failed > +Warning: Ignoring invalid input line +%zz -- id:whatever > +Warning: Hex decoding of query id:%yy failed > +Warning: Ignoring invalid input line +e +f id:%yy > +Warning: Cannot apply tags to missing message: foo and bar > +EOF > + > +test_expect_equal_file EXPECTED OUTPUT > + > test_begin_subtest 'roundtripping random message-ids and tags' > > ${TEST_DIRECTORY}/random-corpus --config-path=${NOTMUCH_CONFIG} \ > -- > 1.7.10.4 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch