[PATCH 5/5] Test: Add tests for "notmuch new" command line tags
[notmuch-archives.git] / ac / b116809dfcf558f58cf3f186d5403ae712702a
diff --git a/ac/b116809dfcf558f58cf3f186d5403ae712702a b/ac/b116809dfcf558f58cf3f186d5403ae712702a
new file mode 100644 (file)
index 0000000..59f928e
--- /dev/null
@@ -0,0 +1,94 @@
+Return-Path: <dme@hotblack-desiato.hh.sledj.net>\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 0A5C6429E3B\r
+       for <notmuch@notmuchmail.org>; Fri,  2 May 2014 05:15:09 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.379\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.379 tagged_above=-999 required=5\r
+       tests=[NO_DNS_FOR_FROM=0.379] 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 vXhzWcWaXDOA for <notmuch@notmuchmail.org>;\r
+       Fri,  2 May 2014 05:15:03 -0700 (PDT)\r
+Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net\r
+       [81.149.164.25])\r
+       (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id B0D18429E32\r
+       for <notmuch@notmuchmail.org>; Fri,  2 May 2014 05:14:59 -0700 (PDT)\r
+Received: from hotblack-desiato.hh.sledj.net (hotblack-desiato.hh.sledj.net\r
+       [172.16.100.105])\r
+       by disaster-area.hh.sledj.net (Postfix) with ESMTPSA id 13BA5501560;\r
+       Fri,  2 May 2014 13:14:57 +0100 (BST)\r
+Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
+       id B54E4103463; Fri,  2 May 2014 13:14:56 +0100 (BST)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 5/5] Test: Add tests for "notmuch new" command line tags\r
+Date: Fri,  2 May 2014 13:14:47 +0100\r
+Message-Id: <1399032887-25896-5-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 1.9.2\r
+In-Reply-To: <cuniopogz2l.fsf@hotblack-desiato.hh.sledj.net>\r
+References: <cuniopogz2l.fsf@hotblack-desiato.hh.sledj.net>\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: Fri, 02 May 2014 12:15:09 -0000\r
+\r
+Add a simple set of tests for adding, removing and both adding and\r
+removing tags when running "notmuch new".\r
+---\r
+ test/T540-new-tags.sh | 28 ++++++++++++++++++++++++++++\r
+ 1 file changed, 28 insertions(+)\r
+ create mode 100755 test/T540-new-tags.sh\r
+\r
+diff --git a/test/T540-new-tags.sh b/test/T540-new-tags.sh\r
+new file mode 100755\r
+index 0000000..58e6c18\r
+--- /dev/null\r
++++ b/test/T540-new-tags.sh\r
+@@ -0,0 +1,28 @@\r
++#!/usr/bin/env bash\r
++test_description="'notmuch new' with tags"\r
++. ./test-lib.sh\r
++\r
++which notmuch\r
++\r
++test_begin_subtest "Add tags during new"\r
++generate_message\r
++notmuch new +happyfunball +flyfishing\r
++output=$(notmuch search "id:${gen_msg_id}")\r
++expected='thread:0000000000000001   2001-01-05 [1/1] Notmuch Test Suite; Add tags during new (flyfishing happyfunball inbox unread)'\r
++test_expect_equal "$output" "$expected"\r
++\r
++test_begin_subtest "Remove tags during new"\r
++generate_message\r
++notmuch new -inbox\r
++output=$(notmuch search "id:${gen_msg_id}")\r
++expected='thread:0000000000000002   2001-01-05 [1/1] Notmuch Test Suite; Remove tags during new (unread)'\r
++test_expect_equal "$output" "$expected"\r
++\r
++test_begin_subtest "Add and remove tags during new"\r
++generate_message\r
++notmuch new +happyfunball -inbox\r
++output=$(notmuch search "id:${gen_msg_id}")\r
++expected='thread:0000000000000003   2001-01-05 [1/1] Notmuch Test Suite; Add and remove tags during new (happyfunball unread)'\r
++test_expect_equal "$output" "$expected"\r
++\r
++test_done\r
+-- \r
+1.9.2\r
+\r