[PATCH] test/new: extend (and break) reference loop test

Subject: [PATCH] test/new: extend (and break) reference loop test

Date: Fri, 14 Aug 2026 09:15:05 -0300

To: Brian May, notmuch@notmuchmail.org

Cc:

From: David Bremner


Brian May [1] reported a problem showing a message that claims to be a
reply to itself. The added message attempts to duplicate the issue
described there. Although the updated test is nominally a test of
notmuch new, it actually illustrates a bug in notmuch show.

[1]: id:87mrvbj37j.fsf@linuxpenguins.xyz
---
 test/T050-new.sh                 | 2 ++
 test/corpora/broken/loop/loop-00 | 9 +++++++++
 2 files changed, 11 insertions(+)
 create mode 100644 test/corpora/broken/loop/loop-00

diff --git a/test/T050-new.sh b/test/T050-new.sh
index 52888be2..5f1352fd 100755
--- a/test/T050-new.sh
+++ b/test/T050-new.sh
@@ -462,11 +462,13 @@ test_begin_subtest "reference loop does not crash"
 test_expect_code 0 "notmuch show --format=json id:mid-loop-12@example.org id:mid-loop-21@example.org > OUTPUT"
 
 test_begin_subtest "reference loop ordered by date"
+test_subtest_known_broken
 threadid=$(notmuch search --output=threads id:mid-loop-12@example.org)
 notmuch show --format=mbox $threadid | grep '^Date' > OUTPUT
 cat <<EOF > EXPECTED
 Date: Thu, 16 Jun 2016 22:14:41 -0400
 Date: Fri, 17 Jun 2016 22:14:41 -0400
+Date: Thu, 16 Jun 2018 22:14:41 -0400
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
diff --git a/test/corpora/broken/loop/loop-00 b/test/corpora/broken/loop/loop-00
new file mode 100644
index 00000000..8ce01cbd
--- /dev/null
+++ b/test/corpora/broken/loop/loop-00
@@ -0,0 +1,9 @@
+From: Alice <alice@example.org>
+To: Daniel <daniel@example.org>
+Subject: self reference is best reference
+Message-ID: <mid-loop-00@example.org>
+In-Reply-To: <mid-loop-00@example.org>
+References: <mid-loop-12@example.org>
+Date: Thu, 16 Jun 2018 22:14:41 -0400
+
+This message is in reply to itself
-- 
2.53.0

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: