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 48DDB431FAF for ; Sat, 8 Dec 2012 11:17:05 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 S4HnjhSufBMk for ; Sat, 8 Dec 2012 11:17:04 -0800 (PST) Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 2958C431FAE for ; Sat, 8 Dec 2012 11:17:04 -0800 (PST) Received: from fctnnbsc30w-142167090129.dhcp-dynamic.fibreop.nb.bellaliant.net ([142.167.90.129] helo=zancas.localnet) by tesseract.cs.unb.ca with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1ThPtW-0005uO-Hx; Sat, 08 Dec 2012 15:17:03 -0400 Received: from bremner by zancas.localnet with local (Exim 4.80) (envelope-from ) id 1ThPtO-0000NI-Ux; Sat, 08 Dec 2012 15:16:54 -0400 From: david@tethera.net To: notmuch@notmuchmail.org Subject: [PATCH] test: Adding non-maildir tags does not move message from new to cur Date: Sat, 8 Dec 2012 15:15:32 -0400 Message-Id: <1354994132-866-1-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1316039001-32602-5-git-send-email-l.rilling@av7.net> References: <1316039001-32602-5-git-send-email-l.rilling@av7.net> X-Spam_bar: - Cc: Michal Sojka 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, 08 Dec 2012 19:17:05 -0000 From: Michal Sojka Some MUA's like mutt show the difference between "new" emails living in maildir directory new/, and "old" emails living in maildir directory cur/. However notmuch tag unconditionally moves selected messages from new/ to cur/, even if no maildir synchronized tag is changed. While maildir specification forbids messages with tags living in new/, there is no need to move messages to cur/ when no maildir synchronized tag is changed. Thus notmuch can remain transparent with respect to other MUA's. [ Edited commit log to better describe the intended changes, and tag the test as broken until the actual changes are implemented -- Louis Rilling ] Signed-off-by: Louis Rilling [ Converted to use test_subtest_known_broken, David Bremner ] --- Do we agree that the behaviour of moving messages to ./cur on tagging is broken? If so, maybe it's worth tidying up and applying this. The use of cd and ls strikes me as slightly suspect, but I welcome other opinions. test/maildir-sync | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/maildir-sync b/test/maildir-sync index 0fc742a..6165782 100755 --- a/test/maildir-sync +++ b/test/maildir-sync @@ -83,6 +83,15 @@ test_expect_equal "$output" "No new mail." # creating new directories in the mail store, then it should be # creating all necessary database state for those directories. +test_begin_subtest "Adding non-maildir tags does not move message from new to cur" +test_subtest_known_broken +add_message [subject]='"Message to stay in new"' \ + [date]='"Sat, 01 Jan 2000 12:00:00 -0000"' \ + [filename]='message-to-stay-in-new' [dir]=new +notmuch tag +donotmove subject:"Message to stay in new" +output=$(cd "$MAIL_DIR"; ls */message-to-stay-in-new*) +test_expect_equal "$output" "new/message-to-stay-in-new" + test_begin_subtest "Removing 'S' flag from existing filename adds 'unread' tag" add_message [subject]='"Removing S flag"' [filename]='removing-s-flag:2,S' [dir]=cur output=$(notmuch search subject:"Removing S flag" | notmuch_search_sanitize) -- 1.7.10.4