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 45ECF431E64 for ; Sat, 31 Mar 2012 00:45:23 -0700 (PDT) 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 T1dKgLBflc8d for ; Sat, 31 Mar 2012 00:45:22 -0700 (PDT) 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 78A22431FAF for ; Sat, 31 Mar 2012 00:45:22 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1SDszs-0004em-6H; Sat, 31 Mar 2012 08:45:18 +0100 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1SDszr-0006S1-Sv; Sat, 31 Mar 2012 08:45:16 +0100 From: Mark Walters To: Peter Wang , notmuch@notmuchmail.org Subject: Re: [PATCH v2 2/5] test: Add tests for 'config' command In-Reply-To: <1333149350-22616-3-git-send-email-novalazy@gmail.com> References: <1332282698-7951-1-git-send-email-novalazy@gmail.com> <1333149350-22616-1-git-send-email-novalazy@gmail.com> <1333149350-22616-3-git-send-email-novalazy@gmail.com> User-Agent: Notmuch/0.12+65~g8bf1842 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Sat, 31 Mar 2012 08:45:25 +0100 Message-ID: <877gy1p622.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 94.192.233.223 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 3f9ae8ec3a697831a49261d5b05d41b4 (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.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay * domain * 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: Sat, 31 Mar 2012 07:45:23 -0000 This whole series looks good to me with one minor query. > Start a new test script. > --- > test/config | 20 ++++++++++++++++++++ > test/notmuch-test | 1 + > 2 files changed, 21 insertions(+), 0 deletions(-) > create mode 100755 test/config > > diff --git a/test/config b/test/config > new file mode 100755 > index 0000000..d3e574c > --- /dev/null > +++ b/test/config > @@ -0,0 +1,20 @@ > +#!/usr/bin/env bash > + > +test_description='"notmuch config"' > +. test-lib.sh > + > +test_begin_subtest "Get string value" > +test_expect_equal "$(notmuch config get user.name)" "Notmuch Test Suite" > + > +test_begin_subtest "Get list value" > +test_expect_equal "$(notmuch config get new.tags)" "\ > +unread > +inbox" > + > +test_expect_success "Set string value" \ > + 'notmuch config set foo.bar baz' > + > +test_expect_success "Set list value" \ > + 'notmuch config set foo.list xxx "yyy yyy" "zzz zzz"' It seems off to call is success without checking that the value has actually been set. Of course it is checked in the notmuch config list test introduced in the next commit but I think if it would be better to check with notmuch config get here too (i.e. check that reading back the value gives what you want). Otherwise a failure in `setting' will show up as a test failure in `listing'. Best wishes Mark > + > +test_done > diff --git a/test/notmuch-test b/test/notmuch-test > index f03b594..e08ec72 100755 > --- a/test/notmuch-test > +++ b/test/notmuch-test > @@ -19,6 +19,7 @@ cd $(dirname "$0") > TESTS=" > basic > help-test > + config > new > count > search > -- > 1.7.4.4 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch