1 Return-Path: <pieter@praet.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 91123431E64
\r
6 for <notmuch@notmuchmail.org>; Wed, 1 Feb 2012 06:15:12 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id MT4MKoD5XxI1 for <notmuch@notmuchmail.org>;
\r
16 Wed, 1 Feb 2012 06:15:07 -0800 (PST)
\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com
\r
18 [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id DB00A421192
\r
21 for <notmuch@notmuchmail.org>; Wed, 1 Feb 2012 06:15:06 -0800 (PST)
\r
22 Received: by wibhi8 with SMTP id hi8so995743wib.26
\r
23 for <notmuch@notmuchmail.org>; Wed, 01 Feb 2012 06:15:05 -0800 (PST)
\r
24 Received: by 10.180.89.71 with SMTP id bm7mr11193882wib.20.1328105705643;
\r
25 Wed, 01 Feb 2012 06:15:05 -0800 (PST)
\r
26 Received: from localhost ([109.131.39.11])
\r
27 by mx.google.com with ESMTPS id t15sm45027118wiv.6.2012.02.01.06.15.04
\r
28 (version=TLSv1/SSLv3 cipher=OTHER);
\r
29 Wed, 01 Feb 2012 06:15:05 -0800 (PST)
\r
30 From: Pieter Praet <pieter@praet.org>
\r
31 To: David Edmondson <dme@dme.org>, Tomi Ollila <tomi.ollila@iki.fi>,
\r
32 David Bremner <david@tethera.net>
\r
33 Subject: [PATCH] test: add tests wrt ignoring user-specified files and
\r
35 Date: Wed, 1 Feb 2012 15:12:53 +0100
\r
36 Message-Id: <1328105573-4626-1-git-send-email-pieter@praet.org>
\r
37 X-Mailer: git-send-email 1.7.8.1
\r
38 In-Reply-To: <cunr4yonvn4.fsf@hotblack-desiato.hh.sledj.net>
\r
39 References: <cunr4yonvn4.fsf@hotblack-desiato.hh.sledj.net>
\r
40 Cc: Notmuch Mail <notmuch@notmuchmail.org>
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Wed, 01 Feb 2012 14:15:12 -0000
\r
55 Files and directories which are specified in 'new.ignore' in the
\r
56 config file shouldn't be indexed nor reported by `notmuch new'.
\r
59 test/new | 23 +++++++++++++++++++++++
\r
60 1 files changed, 23 insertions(+), 0 deletions(-)
\r
62 diff --git a/test/new b/test/new
\r
63 index 49f390d..740ba05 100755
\r
66 @@ -153,4 +153,27 @@ rm -rf "${MAIL_DIR}"/two
\r
67 output=$(NOTMUCH_NEW)
\r
68 test_expect_equal "$output" "No new mail. Removed 3 messages."
\r
70 +test_begin_subtest "Skip and report non-mail files"
\r
72 +mkdir -p "${MAIL_DIR}"/.git && touch "${MAIL_DIR}"/.git/config
\r
73 +touch "${MAIL_DIR}"/ignored_file
\r
74 +touch "${MAIL_DIR}"/.ignored_hidden_file
\r
75 +output=$(NOTMUCH_NEW 2>&1)
\r
76 +test_expect_equal "$output" \
\r
77 +"Note: Ignoring non-mail file: ${MAIL_DIR}/.git/config
\r
78 +Note: Ignoring non-mail file: ${MAIL_DIR}/.ignored_hidden_file
\r
79 +Note: Ignoring non-mail file: ${MAIL_DIR}/ignored_file
\r
80 +Added 1 new message to the database."
\r
82 +test_begin_subtest "Ignore files and directories specified in new.ignore"
\r
83 +test_subtest_known_broken
\r
85 +notmuch config set new.ignore .git ignored_file .ignored_hidden_file
\r
86 +mkdir -p "${MAIL_DIR}"/.git && touch "${MAIL_DIR}"/.git/config
\r
87 +touch "${MAIL_DIR}"/ignored_file
\r
88 +touch "${MAIL_DIR}"/.ignored_hidden_file
\r
89 +output=$(NOTMUCH_NEW 2>&1)
\r
90 +test_expect_equal "$output" "Added 1 new message to the database."
\r