[PATCH 1/5] test: add known broken test for good In-Reply-To / bad References
David Bremner
david at tethera.net
Mon Jul 23 01:22:55 PDT 2018
The current scheme of choosing the replyto (i.e. the default parent
for threading purposes) does not work well for mailers that put
the oldest Reference last.
---
test/T510-thread-replies.sh | 27 +++++++++++++++++++
.../threading/parent-priority/cur/child | 11 ++++++++
.../threading/parent-priority/cur/grand-child | 10 +++++++
.../threading/parent-priority/cur/root | 7 +++++
4 files changed, 55 insertions(+)
create mode 100644 test/corpora/threading/parent-priority/cur/child
create mode 100644 test/corpora/threading/parent-priority/cur/grand-child
create mode 100644 test/corpora/threading/parent-priority/cur/root
diff --git a/test/T510-thread-replies.sh b/test/T510-thread-replies.sh
index 6837ff17..a19669a9 100755
--- a/test/T510-thread-replies.sh
+++ b/test/T510-thread-replies.sh
@@ -165,4 +165,31 @@ expected=`echo "$expected" | notmuch_json_show_sanitize`
test_expect_equal_json "$output" "$expected"
+add_email_corpus threading
+
+test_begin_subtest "trusting reply-to"
+test_subtest_known_broken
+notmuch show --entire-thread=true id:B00-root at example.org | grep ^Subject: > OUTPUT
+cat <<EOF > EXPECTED
+Subject: root message
+Subject: child message
+Subject: grand-child message
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "trusting reply-to (tree view)"
+test_subtest_known_broken
+test_emacs '(notmuch-tree "id:B00-root at example.org")
+ (notmuch-test-wait)
+ (test-output)
+ (delete-other-windows)'
+cat <<EOF > EXPECTED
+ 2016-06-17 Alice â¬âºroot message (inbox unread)
+ 2016-06-18 Alice â°â¬âºchild message (inbox unread)
+ 2016-06-18 Alice â°ââºgrand-child message (inbox unread)
+End of search results.
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
+
test_done
diff --git a/test/corpora/threading/parent-priority/cur/child b/test/corpora/threading/parent-priority/cur/child
new file mode 100644
index 00000000..23ee6495
--- /dev/null
+++ b/test/corpora/threading/parent-priority/cur/child
@@ -0,0 +1,11 @@
+From: Alice <alice at example.org>
+To: Daniel <daniel at example.org>
+Subject: child message
+Message-ID: <B01-child at example.org>
+In-Reply-To: <B00-root at example.org>
+References: <B00--root at example.org>
+Date: Fri, 17 Jun 2016 22:14:41 -0400
+
+This is a normal-ish reply, and has both a references header and an
+in-reply-to header.
+
diff --git a/test/corpora/threading/parent-priority/cur/grand-child b/test/corpora/threading/parent-priority/cur/grand-child
new file mode 100644
index 00000000..028371d4
--- /dev/null
+++ b/test/corpora/threading/parent-priority/cur/grand-child
@@ -0,0 +1,10 @@
+From: Alice <alice at example.org>
+To: Daniel <daniel at example.org>
+Subject: grand-child message
+Message-ID: <B01-grand-child at example.org>
+In-Reply-To: <B01-child at example.org>
+References: <B01-child at example.org> <B00-root at example.org>
+Date: Fri, 17 Jun 2016 22:24:41 -0400
+
+This has the references headers in the wrong order, with oldest first.
+Debbugs does this.
diff --git a/test/corpora/threading/parent-priority/cur/root b/test/corpora/threading/parent-priority/cur/root
new file mode 100644
index 00000000..3990843d
--- /dev/null
+++ b/test/corpora/threading/parent-priority/cur/root
@@ -0,0 +1,7 @@
+From: Alice <alice at example.org>
+To: Daniel <daniel at example.org>
+Subject: root message
+Message-ID: <B00-root at example.org>
+Date: Thu, 16 Jun 2016 22:14:41 -0400
+
+This message has no reply-to
--
2.18.0
More information about the notmuch
mailing list