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 37482431E82 for ; Wed, 15 Feb 2012 01:17:37 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 dAa0VgLeV4V5 for ; Wed, 15 Feb 2012 01:17:35 -0800 (PST) Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66]) by olra.theworths.org (Postfix) with ESMTP id 1898C431FBD for ; Wed, 15 Feb 2012 01:17:35 -0800 (PST) Received: by guru.guru-group.fi (Postfix, from userid 501) id B4C2A68056; Wed, 15 Feb 2012 11:17:36 +0200 (EET) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH v7 1/3] test: add tests wrt ignoring user-specified files and directories Date: Wed, 15 Feb 2012 11:17:30 +0200 Message-Id: <1329297452-20852-2-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 1.7.6.1 In-Reply-To: <1329297452-20852-1-git-send-email-tomi.ollila@iki.fi> References: <1315949524-4948-1-git-send-email-tomi.ollila@iki.fi> <1329297452-20852-1-git-send-email-tomi.ollila@iki.fi> Cc: Tomi Ollila 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: Wed, 15 Feb 2012 09:17:37 -0000 Files and directories which are specified in 'new.ignore' in the config file shouldn't be indexed nor reported by `notmuch new'. This is basically Pieter's work with Austin's comments addressed. --- test/new | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/test/new b/test/new index 49f390d..e453684 100755 --- a/test/new +++ b/test/new @@ -153,4 +153,26 @@ rm -rf "${MAIL_DIR}"/two output=$(NOTMUCH_NEW) test_expect_equal "$output" "No new mail. Removed 3 messages." +# This test requires that notmuch new has been run at least once. +test_begin_subtest "Skip and report non-mail files" +generate_message +mkdir -p "${MAIL_DIR}"/.git && touch "${MAIL_DIR}"/.git/config +touch "${MAIL_DIR}"/ignored_file +touch "${MAIL_DIR}"/.ignored_hidden_file +output=$(NOTMUCH_NEW 2>&1) +test_expect_equal "$output" \ +"Note: Ignoring non-mail file: ${MAIL_DIR}/.git/config +Note: Ignoring non-mail file: ${MAIL_DIR}/.ignored_hidden_file +Note: Ignoring non-mail file: ${MAIL_DIR}/ignored_file +Added 1 new message to the database." + +test_begin_subtest "Ignore files and directories specified in new.ignore" +test_subtest_known_broken +generate_message +notmuch config set new.ignore .git ignored_file .ignored_hidden_file +touch "${MAIL_DIR}"/.git # change .git's mtime for notmuch new to rescan. +output=$(NOTMUCH_NEW 2>&1) +test_expect_equal "$output" "Added 1 new message to the database." + + test_done -- 1.7.8.2