From a5dc49d2fce79608f9740351aa34c2c69a7332cb Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Mon, 26 May 2014 16:05:56 +0200 Subject: [PATCH] [PATCH 1/2] Add test for incorrect threading of messages --- 02/6d86eee55674e91ff696381eba68e4f6c1eb37 | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 02/6d86eee55674e91ff696381eba68e4f6c1eb37 diff --git a/02/6d86eee55674e91ff696381eba68e4f6c1eb37 b/02/6d86eee55674e91ff696381eba68e4f6c1eb37 new file mode 100644 index 000000000..eaf3584ff --- /dev/null +++ b/02/6d86eee55674e91ff696381eba68e4f6c1eb37 @@ -0,0 +1,103 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 19256431FAF + for ; Mon, 26 May 2014 07:06:26 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id e6NDeOsjDYPB for ; + Mon, 26 May 2014 07:06:18 -0700 (PDT) +Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) + by olra.theworths.org (Postfix) with ESMTP id 6705A431FC0 + for ; Mon, 26 May 2014 07:06:13 -0700 (PDT) +Received: from localhost (unknown [192.168.200.7]) + by max.feld.cvut.cz (Postfix) with ESMTP id E302519F362E + for ; Mon, 26 May 2014 16:06:05 +0200 (CEST) +X-Virus-Scanned: IMAP STYX AMAVIS +Received: from max.feld.cvut.cz ([192.168.200.1]) + by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new, + port 10044) with ESMTP id HXTsqpTafj8f for ; + Mon, 26 May 2014 16:06:02 +0200 (CEST) +Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) + by max.feld.cvut.cz (Postfix) with ESMTP id F091B19F3634 + for ; Mon, 26 May 2014 16:06:01 +0200 (CEST) +Received: from wsh by steelpick.2x.cz with local (Exim 4.82) + (envelope-from ) + id 1WovXM-0008S9-10; Mon, 26 May 2014 16:06:00 +0200 +From: Michal Sojka +To: notmuch@notmuchmail.org +Subject: [PATCH 1/2] Add test for incorrect threading of messages +Date: Mon, 26 May 2014 16:05:56 +0200 +Message-Id: <1401113157-32454-2-git-send-email-sojkam1@fel.cvut.cz> +X-Mailer: git-send-email 2.0.0.rc2 +In-Reply-To: <1401113157-32454-1-git-send-email-sojkam1@fel.cvut.cz> +References: <1401113157-32454-1-git-send-email-sojkam1@fel.cvut.cz> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 26 May 2014 14:06:26 -0000 + +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. +--- + test/T510-thread-replies.sh | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +diff --git a/test/T510-thread-replies.sh b/test/T510-thread-replies.sh +index eeb70d0..d818b89 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]=" (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 +-- +2.0.0.rc2 + -- 2.26.2