test: add test for both adding and removing a tag at the same time
authorJani Nikula <jani@nikula.org>
Mon, 26 Mar 2012 21:04:08 +0000 (00:04 +0300)
committerDavid Bremner <bremner@debian.org>
Sat, 31 Mar 2012 00:20:21 +0000 (21:20 -0300)
The current behaviour is that regardless of the order in which the
addition and removal of a tag are specified, the tag is added.

Signed-off-by: Jani Nikula <jani@nikula.org>
test/tagging

index 77202bf98ff19084312364e655a8fdad6f493125..3acf1bc043261fc9418549969b5acec7e14d6d6c 100755 (executable)
@@ -38,4 +38,12 @@ test_expect_equal "$output" "\
 thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One (:\"  inbox tag1 unread)
 thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 unread)"
 
+test_begin_subtest "Tagging order"
+notmuch tag +tag4 -tag4 One
+notmuch tag -tag4 +tag4 Two
+output=$(notmuch search \* | notmuch_search_sanitize)
+test_expect_equal "$output" "\
+thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One (:\"  inbox tag1 tag4 unread)
+thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag4 unread)"
+
 test_done