[PATCH 5/5] Test: Add tests for "notmuch new" command line tags

Subject:[PATCH 5/5] Test: Add tests for "notmuch new" command line tags

Date:Fri, 2 May 2014 09:15:55 +0100

To:notmuch@notmuchmail.org

Cc:

From:David Edmondson


Add a simple set of tests for adding, removing and both adding and
removing tags when running "notmuch new".
---
 test/T540-new-tags.sh | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100755 test/T540-new-tags.sh

diff --git a/test/T540-new-tags.sh b/test/T540-new-tags.sh
new file mode 100755
index 0000000..58e6c18
--- /dev/null
+++ b/test/T540-new-tags.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+test_description="'notmuch new' with tags"
+. ./test-lib.sh
+
+which notmuch
+
+test_begin_subtest "Add tags during new"
+generate_message
+notmuch new +happyfunball +flyfishing
+output=$(notmuch search "id:${gen_msg_id}")
+expected='thread:0000000000000001   2001-01-05 [1/1] Notmuch Test Suite; Add tags during new (flyfishing happyfunball inbox unread)'
+test_expect_equal "$output" "$expected"
+
+test_begin_subtest "Remove tags during new"
+generate_message
+notmuch new -inbox
+output=$(notmuch search "id:${gen_msg_id}")
+expected='thread:0000000000000002   2001-01-05 [1/1] Notmuch Test Suite; Remove tags during new (unread)'
+test_expect_equal "$output" "$expected"
+
+test_begin_subtest "Add and remove tags during new"
+generate_message
+notmuch new +happyfunball -inbox
+output=$(notmuch search "id:${gen_msg_id}")
+expected='thread:0000000000000003   2001-01-05 [1/1] Notmuch Test Suite; Add and remove tags during new (happyfunball unread)'
+test_expect_equal "$output" "$expected"
+
+test_done
-- 
1.9.2


Thread: