[PATCH 1/2] test: Add test for messages without maildir info in new

Subject: [PATCH 1/2] test: Add test for messages without maildir info in new

Date: Sun, 21 Nov 2010 00:27:39 +0100

To: notmuch@notmuchmail.org

Cc:

From: Michal Sojka


A message in new without maildir info should be tagged the same as if
empty info (:,2) is present, i.e. unread tag must be present.

To test this behavior, notmuch new must be configured to add only inbox
tag and not two tags inbox and unread, which is the default.
---
 test/maildir-sync |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/test/maildir-sync b/test/maildir-sync
index 50a5b8e..4419a7e 100755
--- a/test/maildir-sync
+++ b/test/maildir-sync
@@ -4,6 +4,11 @@ test_description="maildir synchronization"
 
 . ./test-lib.sh
 
+cat <<EOF >>"${NOTMUCH_CONFIG}"
+[new]
+tags=inbox;
+EOF
+
 # Much easier to examine differences if the "notmuch show
 # --format=json" output includes some newlines. Also, need to avoid
 # including the local value of MAIL_DIR in the result.
@@ -175,4 +180,9 @@ add_message [subject]='"Non-compliant maildir info"' [dir]=cur [filename]='non-c
 notmuch tag +unread +draft -flagged subject:"Non-compliant maildir info"
 test_expect_equal "$(cd $MAIL_DIR/cur/; ls non-compliant*)" "non-compliant-maildir-info:2,These-are-not-flags-in-ASCII-order-donottouch"
 
+test_begin_subtest "Message in new without maildir info is tagges as unread"
+add_message [subject]='"Message in new without maildir info"' [date]='"Sat, 01 Jan 2000 12:00:00 -0000"' [filename]='message-in-new-without-maildir-info' [dir]=new
+output=$(notmuch search subject:"Message in new without maildir info" | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; Message in new without maildir info (inbox unread)"
+
 test_done
-- 
1.7.1.90.g94d6d4


Thread: