From: Pieter Praet Date: Wed, 1 Feb 2012 14:12:53 +0000 (+0100) Subject: [PATCH] test: add tests wrt ignoring user-specified files and directories X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=7a9ce154ce876243a5eb886376624d2ecf3a951c;p=notmuch-archives.git [PATCH] test: add tests wrt ignoring user-specified files and directories --- diff --git a/ea/013f7a79fa356b21086c0512c13ae9b4e141f4 b/ea/013f7a79fa356b21086c0512c13ae9b4e141f4 new file mode 100644 index 000000000..f198603ff --- /dev/null +++ b/ea/013f7a79fa356b21086c0512c13ae9b4e141f4 @@ -0,0 +1,96 @@ +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 91123431E64 + for ; Wed, 1 Feb 2012 06:15:12 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 MT4MKoD5XxI1 for ; + Wed, 1 Feb 2012 06:15:07 -0800 (PST) +Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com + [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id DB00A421192 + for ; Wed, 1 Feb 2012 06:15:06 -0800 (PST) +Received: by wibhi8 with SMTP id hi8so995743wib.26 + for ; Wed, 01 Feb 2012 06:15:05 -0800 (PST) +Received: by 10.180.89.71 with SMTP id bm7mr11193882wib.20.1328105705643; + Wed, 01 Feb 2012 06:15:05 -0800 (PST) +Received: from localhost ([109.131.39.11]) + by mx.google.com with ESMTPS id t15sm45027118wiv.6.2012.02.01.06.15.04 + (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 01 Feb 2012 06:15:05 -0800 (PST) +From: Pieter Praet +To: David Edmondson , Tomi Ollila , + David Bremner +Subject: [PATCH] test: add tests wrt ignoring user-specified files and + directories +Date: Wed, 1 Feb 2012 15:12:53 +0100 +Message-Id: <1328105573-4626-1-git-send-email-pieter@praet.org> +X-Mailer: git-send-email 1.7.8.1 +In-Reply-To: +References: +Cc: Notmuch Mail +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, 01 Feb 2012 14:15:12 -0000 + +Files and directories which are specified in 'new.ignore' in the +config file shouldn't be indexed nor reported by `notmuch new'. + +--- + test/new | 23 +++++++++++++++++++++++ + 1 files changed, 23 insertions(+), 0 deletions(-) + +diff --git a/test/new b/test/new +index 49f390d..740ba05 100755 +--- a/test/new ++++ b/test/new +@@ -153,4 +153,27 @@ rm -rf "${MAIL_DIR}"/two + output=$(NOTMUCH_NEW) + test_expect_equal "$output" "No new mail. Removed 3 messages." + ++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 ++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" "Added 1 new message to the database." ++ ++ + test_done +-- +1.7.8.1 +