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 ABC34431FD9 for ; Tue, 24 Mar 2015 06:20:55 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 2.438 X-Spam-Level: ** X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 tests=[DNS_FROM_AHBL_RHSBL=2.438] 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 eehgONyoj9Uo for ; Tue, 24 Mar 2015 06:20:52 -0700 (PDT) Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net [87.98.215.224]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 62AF9431FD2 for ; Tue, 24 Mar 2015 06:20:52 -0700 (PDT) Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim 4.80) (envelope-from ) id 1YaOkV-0000pF-O9; Tue, 24 Mar 2015 13:20:03 +0000 Received: (nullmailer pid 32627 invoked by uid 1000); Tue, 24 Mar 2015 13:19:47 -0000 From: David Bremner To: David Bremner , notmuch@notmuchmail.org Subject: [Patch v5 1/8] test: Add two tests for error output from notmuch_database_open Date: Tue, 24 Mar 2015 09:19:39 -0400 Message-Id: <1427203186-32194-1-git-send-email-david@tethera.net> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426352554-4383-10-git-send-email-david@tethera.net> References: <1426352554-4383-10-git-send-email-david@tethera.net> 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 Mar 2015 13:20:55 -0000 This is arguably testing the same thing twice, but in the brave new future where we don't use printf anymore, each subcommand will be responsible for handling the output on it's own. --- test/T050-new.sh | 7 +++++++ test/T150-tagging.sh | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/test/T050-new.sh b/test/T050-new.sh index 7119356..e6c3291 100755 --- a/test/T050-new.sh +++ b/test/T050-new.sh @@ -276,4 +276,11 @@ test_expect_code 1 "Invalid tags set exit code" \ notmuch config set new.tags $OLDCONFIG + +test_begin_subtest "Xapian exception: read only files" +chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB +output=$(NOTMUCH_NEW 2>&1 | sed 's/: .*$//' ) +chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB +test_expect_equal "$output" "A Xapian exception occurred opening database" + test_done diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh index 45471ac..4a2673d 100755 --- a/test/T150-tagging.sh +++ b/test/T150-tagging.sh @@ -261,4 +261,10 @@ test_expect_code 1 "Empty tag names" 'notmuch tag + One' test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One' +test_begin_subtest "Xapian exception: read only files" +chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB +output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' ) +chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB +test_expect_equal "$output" "A Xapian exception occurred opening database" + test_done -- 2.1.4