aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/corpus/foo/new/10:2,
diff options
context:
space:
mode:
authorGravatar Jani Nikula <jani@nikula.org>2014-03-09 14:25:37 +0200
committerGravatar David Bremner <david@tethera.net>2014-03-11 19:50:12 -0300
commitded713c39d8b0221a3b1b2b52a74966c20c3aba8 (patch)
tree018da27a979738c09760b5fbbda3253cc5ff998f /test/corpus/foo/new/10:2,
parent7630f300ba52f4aab22ee696fe1507d0ef9790bc (diff)
test: rearrange the test corpus into subfolders, fix tests
We will need this for improved folder search tests, but having some folders should exercise our code paths better anyway. Modify the relevant test accordingly to make it pass. This reorganization triggers a bug in the test suite, namely that it expects the output of --output=files to be in a certain order. So we add the fix for that into the same commit. This mainly involves sorting, although the case --duplicate=$n requires more subtlety.
Diffstat (limited to 'test/corpus/foo/new/10:2,')
-rw-r--r--test/corpus/foo/new/10:2,54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/corpus/foo/new/10:2, b/test/corpus/foo/new/10:2,
new file mode 100644
index 00000000..4211d734
--- /dev/null
+++ b/test/corpus/foo/new/10:2,
@@ -0,0 +1,54 @@
+From: "Mikhail Gusarov" <dottedmag@dottedmag.net>
+To: notmuch@notmuchmail.org
+Date: Wed, 18 Nov 2009 02:51:18 +0600
+Subject: [notmuch] [PATCH] Handle rename of message file
+Message-ID: <1258491078-29658-1-git-send-email-dottedmag@dottedmag.net>
+
+If message file has been renamed, just update filename in the DB.
+
+Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
+---
+ lib/database.cc | 21 ++++++++++++---------
+ 1 files changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/lib/database.cc b/lib/database.cc
+index 3c8d626..c4eb8b6 100644
+--- a/lib/database.cc
++++ b/lib/database.cc
+@@ -925,20 +925,23 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
+ if (private_status == NOTMUCH_PRIVATE_STATUS_NO_DOCUMENT_FOUND) {
+ _notmuch_message_set_filename (message, filename);
+ _notmuch_message_add_term (message, "type", "mail");
++
++ ret = _notmuch_database_link_message (notmuch, message, message_file);
++ if (ret)
++ goto DONE;
++
++ date = notmuch_message_file_get_header (message_file, "date");
++ _notmuch_message_set_date (message, date);
++
++ _notmuch_message_index_file (message, filename);
++ } else if (strcmp(notmuch_message_get_filename(message), filename)) {
++ /* Message file has been moved/renamed */
++ _notmuch_message_set_filename (message, filename);
+ } else {
+ ret = NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID;
+ goto DONE;
+ }
+
+- ret = _notmuch_database_link_message (notmuch, message, message_file);
+- if (ret)
+- goto DONE;
+-
+- date = notmuch_message_file_get_header (message_file, "date");
+- _notmuch_message_set_date (message, date);
+-
+- _notmuch_message_index_file (message, filename);
+-
+ _notmuch_message_sync (message);
+ } catch (const Xapian::Error &error) {
+ fprintf (stderr, "A Xapian exception occurred: %s.\n",
+--
+1.6.3.3
+
+