aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Michal Sojka <sojkam1@fel.cvut.cz>2014-05-26 16:05:56 +0200
committerGravatar David Bremner <david@tethera.net>2014-08-16 17:45:07 -0700
commit61993923b4b2e8c9871cc60681e91896c55e169c (patch)
tree77b1c79c9bc326b3935dd765322a97f42ee6d8d9 /test
parentc1845bf0a430b1d0bda6703246a1bcc8962175ab (diff)
Add test for incorrect threading of messages
This happens when there is some garbage after the last Message-ID in the References header. See for example https://lkml.org/lkml/headers/2014/5/19/864.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T510-thread-replies.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/T510-thread-replies.sh b/test/T510-thread-replies.sh
index eeb70d06..d818b89f 100755
--- a/test/T510-thread-replies.sh
+++ b/test/T510-thread-replies.sh
@@ -137,5 +137,33 @@ expected='[[[{"id": "foo@four.com", "match": true, "excluded": false,
expected=`echo "$expected" | notmuch_json_show_sanitize`
test_expect_equal_json "$output" "$expected"
+test_begin_subtest "Ignore garbage at the end of References"
+test_subtest_known_broken
+add_message '[id]="foo@five.com"' \
+ '[subject]="five"'
+add_message '[id]="bar@five.com"' \
+ '[references]="<foo@five.com> (garbage)"' \
+ '[subject]="not-five"'
+output=$(notmuch show --format=json 'subject:five' | notmuch_json_show_sanitize)
+expected='[[[{"id": "XXXXX", "match": true, "excluded": false,
+ "filename": "YYYYY", "timestamp": 42, "date_relative": "2001-01-05",
+ "tags": ["inbox", "unread"], "headers": {"Subject": "five",
+ "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",
+ "To": "Notmuch Test Suite <test_suite@notmuchmail.org>",
+ "Date": "GENERATED_DATE"}, "body": [{"id": 1,
+ "content-type": "text/plain",
+ "content": "This is just a test message (#10)\n"}]},
+ [[{"id": "XXXXX", "match": true, "excluded": false,
+ "filename": "YYYYY", "timestamp": 42, "date_relative": "2001-01-05",
+ "tags": ["inbox", "unread"],
+ "headers": {"Subject": "not-five",
+ "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",
+ "To": "Notmuch Test Suite <test_suite@notmuchmail.org>",
+ "Date": "GENERATED_DATE"},
+ "body": [{"id": 1, "content-type": "text/plain",
+ "content": "This is just a test message (#11)\n"}]}, []]]]]]'
+expected=`echo "$expected" | notmuch_json_show_sanitize`
+test_expect_equal_json "$output" "$expected"
+
test_done