From: david@tethera.net
To: notmuch@notmuchmail.org
Cc: David Bremner <bremner@debian.org>
Subject: [Patch v2 7/9] test/tagging: add test for exotic message-ids and batch tagging
Date: Sun, 6 Jan 2013 23:16:52 -0400 [thread overview]
Message-ID: <1357528614-6413-8-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1357528614-6413-1-git-send-email-david@tethera.net>
From: David Bremner <bremner@debian.org>
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 | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/test/tagging b/test/tagging
index 417112b..1717e72 100755
--- a/test/tagging
+++ b/test/tagging
@@ -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'
--
1.7.10.4
next prev parent reply other threads:[~2013-01-07 3:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 3:16 Xapian-quoting based batch tagging david
2013-01-07 3:16 ` [Patch v2 1/9] tag-util: factor out rules for illegal tags, use in parse_tag_line david
2013-01-07 3:16 ` [Patch v2 2/9] notmuch-tag.c: convert to use tag-utils david
2013-01-07 18:52 ` Jani Nikula
2013-01-07 20:30 ` Tomi Ollila
2013-01-07 3:16 ` [Patch v2 3/9] cli: add support for batch tagging operations to "notmuch tag" david
2013-01-07 3:16 ` [Patch v2 4/9] test/tagging: add test for error messages of tag --batch david
2013-01-07 3:16 ` [Patch v2 5/9] test/tagging: add basic tests for batch tagging functionality david
2013-01-07 3:16 ` [Patch v2 6/9] test/tagging: add tests for exotic tags david
2013-01-07 3:16 ` david [this message]
2013-01-07 3:16 ` [Patch v2 8/9] man: document notmuch tag --batch, --input options david
2013-01-07 3:16 ` [Patch v2 9/9] test/tagging: add test for naked punctuation in tags; compare with quoting spaces david
2013-01-07 18:53 ` Xapian-quoting based batch tagging Jani Nikula
2013-01-08 0:56 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1357528614-6413-8-git-send-email-david@tethera.net \
--to=david@tethera.net \
--cc=bremner@debian.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).