unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michal Sojka <sojkam1@fel.cvut.cz>
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	[thread overview]
Message-ID: <1290295660-1508-1-git-send-email-sojkam1@fel.cvut.cz> (raw)
In-Reply-To: <87pqtzk254.fsf@wsheee.2x.cz>

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

  reply	other threads:[~2010-11-20 23:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11 13:04 Maildir-flags synchronization now on master branch Carl Worth
2010-11-11 14:11 ` Kristoffer Ström
2010-11-11 22:38   ` Carl Worth
2010-11-12  0:43 ` Carl Worth
2010-11-12  1:43   ` Dirk Hohndel
2010-11-18 15:37 ` Ruben Pollan
2010-11-19 15:41   ` [PATCH] Including 'unread' tag to mails without maildir flags meskio
2010-11-20 23:26     ` Michal Sojka
2010-11-20 23:27       ` Michal Sojka [this message]
2010-11-20 23:27       ` [PATCH 2/2] Include 'unread' tag only to mails in new Michal Sojka
2010-11-22 10:43         ` Ruben Pollan
2010-11-20 23:54       ` [PATCH] Additional maildir-sync test Michal Sojka
2010-11-22 10:41         ` Ruben

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290295660-1508-1-git-send-email-sojkam1@fel.cvut.cz \
    --to=sojkam1@fel.cvut.cz \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).