X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT510-thread-replies.sh;h=5ab066ac7baab83c3822172993f34fb48161ecf4;hp=eeb70d06071459b8af03418ffeeccdda70729274;hb=693ca8d8a80438ce1e361e7e6d22288f52a11c55;hpb=957fc2e1a7d00636c7eaaf487edae65e7a63dc8f diff --git a/test/T510-thread-replies.sh b/test/T510-thread-replies.sh index eeb70d06..5ab066ac 100755 --- a/test/T510-thread-replies.sh +++ b/test/T510-thread-replies.sh @@ -9,7 +9,7 @@ test_description='test of proper handling of in-reply-to and references headers' # database is constructed properly, even in the presence of # non-RFC-compliant headers' -. ./test-lib.sh +. ./test-lib.sh || exit 1 test_begin_subtest "Use References when In-Reply-To is broken" add_message '[id]="foo@one.com"' \ @@ -137,5 +137,32 @@ 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" +add_message '[id]="foo@five.com"' \ + '[subject]="five"' +add_message '[id]="bar@five.com"' \ + '[references]=" (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 ", + "To": "Notmuch Test Suite ", + "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 ", + "To": "Notmuch Test Suite ", + "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