diff options
author | Tomi Ollila <tomi.ollila@iki.fi> | 2012-02-15 11:17:30 +0200 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-02-17 08:04:23 -0400 |
commit | 863c1495141084dd1e66a73be35560b2531b71bf (patch) | |
tree | 2cd937fe87bdd7b8c9919edf6b07ee0c54e470fe /test | |
parent | e4ceb19cc73766e3c0becc537c36679785b215a6 (diff) |
test: add tests wrt ignoring user-specified files and directories
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.
Diffstat (limited to 'test')
-rwxr-xr-x | test/new | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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 |