]> git.notmuchmail.org Git - notmuch/commitdiff
test/tagging: add test for exotic message-ids and batch tagging
authorDavid Bremner <bremner@debian.org>
Tue, 25 Dec 2012 19:42:44 +0000 (15:42 -0400)
committerDavid Bremner <bremner@debian.org>
Tue, 8 Jan 2013 00:49:00 +0000 (20:49 -0400)
The (now fixed) bug that this test revealed is that unquoted
message-ids with whitespace or other control characters in them are
split into several tokens by the Xapian query parser.

test/tagging

index 417112b8dd4fabe9e7c95b20229bce2b3b63092a..1717e72005de37b1044c5193b93e20fc65e1ce63 100755 (executable)
@@ -198,6 +198,24 @@ notmuch dump --format=batch-tag | sort > OUTPUT
 notmuch restore --format=batch-tag < BACKUP
 test_expect_equal_file EXPECTED OUTPUT
 
+test_begin_subtest '--batch: unicode message-ids'
+
+${TEST_DIRECTORY}/random-corpus --config-path=${NOTMUCH_CONFIG} \
+     --num-messages=100
+
+notmuch dump --format=batch-tag | sed 's/^.* -- /+common_tag -- /' | \
+    sort > EXPECTED
+
+notmuch dump --format=batch-tag | sed 's/^.* -- /  -- /' | \
+    notmuch restore --format=batch-tag
+
+notmuch tag --batch < EXPECTED
+
+notmuch dump --format=batch-tag| \
+    sort > OUTPUT
+
+test_expect_equal_file EXPECTED OUTPUT
+
 test_expect_code 1 "Empty tag names" 'notmuch tag + One'
 
 test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One'