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 BA3DE40DF1F for ; Sat, 20 Nov 2010 15:28:05 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham 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 cnG23ucSpRxR for ; Sat, 20 Nov 2010 15:27:53 -0800 (PST) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 8AE0740DF1E for ; Sat, 20 Nov 2010 15:27:53 -0800 (PST) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 4926819F3364; Sun, 21 Nov 2010 00:27:52 +0100 (CET) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id B4kMInLVQOvS; Sun, 21 Nov 2010 00:27:50 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id B2CA119F3356; Sun, 21 Nov 2010 00:27:50 +0100 (CET) Received: from wsheee.2x.cz (unknown [213.29.198.144]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id AF380FA003; Sun, 21 Nov 2010 00:27:50 +0100 (CET) Received: from wsh by wsheee.2x.cz with local (Exim 4.72) (envelope-from ) id 1PJwqU-0000Ov-B6; Sun, 21 Nov 2010 00:27:50 +0100 From: Michal Sojka To: notmuch@notmuchmail.org Subject: [PATCH 1/2] test: Add test for messages without maildir info in new Date: Sun, 21 Nov 2010 00:27:39 +0100 Message-Id: <1290295660-1508-1-git-send-email-sojkam1@fel.cvut.cz> X-Mailer: git-send-email 1.7.1.90.g94d6d4 In-Reply-To: <87pqtzk254.fsf@wsheee.2x.cz> References: <87pqtzk254.fsf@wsheee.2x.cz> 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: Sat, 20 Nov 2010 23:28:05 -0000 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 <>"${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