[PATCH 2/3] test: Add some missing maildir synchronization tests
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 19 Dec 2012 21:32:26 +0000 (22:32 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:52:32 +0000 (09:52 -0800)
cd/c418b024a3b0eb50a898405e7b4e81dc6405e4 [new file with mode: 0644]

diff --git a/cd/c418b024a3b0eb50a898405e7b4e81dc6405e4 b/cd/c418b024a3b0eb50a898405e7b4e81dc6405e4
new file mode 100644 (file)
index 0000000..f14cb31
--- /dev/null
@@ -0,0 +1,92 @@
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 5A136431FBF\r
+       for <notmuch@notmuchmail.org>; Wed, 19 Dec 2012 13:32:56 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id odY-gTWb+pR4 for <notmuch@notmuchmail.org>;\r
+       Wed, 19 Dec 2012 13:32:55 -0800 (PST)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id 24972431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 19 Dec 2012 13:32:55 -0800 (PST)\r
+Received: from localhost (unknown [192.168.200.7])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 50E923CFE80;\r
+       Wed, 19 Dec 2012 22:32:54 +0100 (CET)\r
+X-Virus-Scanned: IMAP STYX AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+       by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new,\r
+       port 10044)\r
+       with ESMTP id rGrElH-B0fUy; Wed, 19 Dec 2012 22:32:53 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 3C6E73CFE85;\r
+       Wed, 19 Dec 2012 22:32:52 +0100 (CET)\r
+Received: from steelpick.2x.cz (unknown [213.29.198.144])\r
+       (Authenticated sender: sojkam1)\r
+       by imap.feld.cvut.cz (Postfix) with ESMTPSA id 29067660969;\r
+       Wed, 19 Dec 2012 22:32:52 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.80)\r
+       (envelope-from <sojkam1@fel.cvut.cz>)\r
+       id 1TlRFu-00077r-RR; Wed, 19 Dec 2012 22:32:46 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/3] test: Add some missing maildir synchronization tests\r
+Date: Wed, 19 Dec 2012 22:32:26 +0100\r
+Message-Id: <1355952747-27350-3-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1355952747-27350-1-git-send-email-sojkam1@fel.cvut.cz>\r
+References: <1355952747-27350-1-git-send-email-sojkam1@fel.cvut.cz>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 19 Dec 2012 21:32:56 -0000\r
+\r
+As mentioned by Jani Nikula in id:87vcccp4y3.fsf@nikula.org, some cases\r
+of maildir synchronization are not covered by our tests. Let's add the\r
+missing tests.\r
+---\r
+ test/maildir-sync |   12 ++++++++++++\r
+ 1 file changed, 12 insertions(+)\r
+\r
+diff --git a/test/maildir-sync b/test/maildir-sync\r
+index 6165782..b2ac89f 100755\r
+--- a/test/maildir-sync\r
++++ b/test/maildir-sync\r
+@@ -92,6 +92,18 @@ notmuch tag +donotmove subject:"Message to stay in new"\r
+ output=$(cd "$MAIL_DIR"; ls */message-to-stay-in-new*)\r
+ test_expect_equal "$output" "new/message-to-stay-in-new"\r
\r
++test_begin_subtest "Message in cur lacking maildir info gets one on any tag change"\r
++add_message [filename]='message-to-get-maildir-info' [dir]=cur\r
++notmuch tag +anytag id:$gen_msg_id\r
++output=$(cd "$MAIL_DIR"; ls */message-to-get-maildir-info*)\r
++test_expect_equal "$output" "cur/message-to-get-maildir-info:2,"\r
++\r
++test_begin_subtest "Message in new with maildir info is moved to cur on any tag change"\r
++add_message [filename]='message-with-info-to-be-moved-to-cur:2,' [dir]=new\r
++notmuch tag +anytag id:$gen_msg_id\r
++output=$(cd "$MAIL_DIR"; ls */message-with-info-to-be-moved-to-cur*)\r
++test_expect_equal "$output" "cur/message-with-info-to-be-moved-to-cur:2,"\r
++\r
+ test_begin_subtest "Removing 'S' flag from existing filename adds 'unread' tag"\r
+ add_message [subject]='"Removing S flag"' [filename]='removing-s-flag:2,S' [dir]=cur\r
+ output=$(notmuch search subject:"Removing S flag" | notmuch_search_sanitize)\r
+-- \r
+1.7.10.4\r
+\r