From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 385E8431FB6 for ; Thu, 27 Jan 2011 02:32:50 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "To" X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 SwmwPv-AuLPJ for ; Thu, 27 Jan 2011 02:32:48 -0800 (PST) Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.31.40]) by olra.theworths.org (Postfix) with ESMTP id F0824431FB5 for ; Thu, 27 Jan 2011 02:32:47 -0800 (PST) Received: from [87.180.65.26] (helo=stokes.schwinge.homeip.net) by smtprelay02.ispgateway.de with esmtpa (Exim 4.68) (envelope-from ) id 1PiP9g-0001cK-Qv for notmuch@notmuchmail.org; Thu, 27 Jan 2011 11:32:45 +0100 Received: (qmail 3325 invoked from network); 27 Jan 2011 10:32:14 -0000 Received: from hsi-kbw-095-208-175-140.hsi5.kabel-badenwuerttemberg.de (95.208.175.140) by stokes.schwinge.homeip.net with QMQP; 27 Jan 2011 10:32:14 -0000 Received: (nullmailer pid 20105 invoked by uid 1000); Thu, 27 Jan 2011 10:32:14 -0000 From: Thomas Schwinge To: notmuch@notmuchmail.org Subject: [PATCH] Add a few tests for searching LWN emails. Date: Thu, 27 Jan 2011 03:31:49 -0700 Message-Id: <1296124309-20072-1-git-send-email-thomas@schwinge.name> X-Mailer: git-send-email 1.7.1 To: notmuch@notmuchmail.org X-Df-Sender: thomas@schwinge.name Cc: Thomas Schwinge 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: Thu, 27 Jan 2011 10:32:50 -0000 These tests should pass -- but they currently don't. Signed-off-by: Thomas Schwinge --- Hallo! I reported this on IRC some weeks ago; here is a more elaborate report. What we get from these emails, is an author named ``LWN.net'', and the ``Weekly Notification'' / ``Mailing Lists'' bits are stripped away. I suspect this may be a misinterpretation in the notmuch address parser, related to the dot in the name. I have not yet looked at the relevant code. The same problem might exist for the To: parser, which I have not yet checked. Grüße, Thomas test/search | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/test/search b/test/search index b180c7f..2ae5640 100755 --- a/test/search +++ b/test/search @@ -3,6 +3,12 @@ test_description='"notmuch search" in several variations' . ./test-lib.sh add_email_corpus +add_message \ + '[from]="LWN.net Weekly Notification "' \ + '[subject]="LWN.net Weekly Edition for January 27, 2011 available"' +add_message \ + '[from]="LWN.net Mailing Lists "' \ + '[subject]="LWN.net newly freed content for January 27, 2011"' test_begin_subtest "Search body" add_message '[subject]="body search"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [body]=bodysearchtest @@ -57,6 +63,34 @@ add_message '[subject]="search by from (name)"' '[date]="Sat, 01 Jan 2000 12:00: output=$(notmuch search from:"Search By From Name" | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread)" +test_begin_subtest "LWN, I:" +output=$(notmuch search from:'lwn.net weekly notification' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] LWN.net Weekly Notification; LWN.net Weekly Edition for January 27, 2011 available (inbox unread)" + +test_begin_subtest "LWN, II:" +output=$(notmuch search from:'lwn.net mailing lists' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] LWN.net Mailing Lists; LWN.net newly freed content for January 27, 2011 (inbox unread)" + +test_begin_subtest "LWN, III:" +output=$(notmuch search from:lwn and from:weekly | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] LWN.net Weekly Notification; LWN.net Weekly Edition for January 27, 2011 available (inbox unread)" + +test_begin_subtest "LWN, IV:" +output=$(notmuch search from:lwn and from:mailing | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] LWN.net Mailing Lists; LWN.net newly freed content for January 27, 2011 (inbox unread)" + +test_begin_subtest "LWN, V:" +output=$(notmuch search from:lwn@lwn.net and subject:weekly | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] LWN.net Weekly Notification; LWN.net Weekly Edition for January 27, 2011 available (inbox unread)" + +test_begin_subtest "LWN, VI:" +output=$(notmuch search from:lwn@lwn.net and subject:mailing | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] LWN.net Mailing Lists; LWN.net newly freed content for January 27, 2011 (inbox unread)" + +test_begin_subtest "LWN, VII:" +output=$(notmuch count from:lwn@lwn.net) +test_expect_equal "$output" 2 + test_begin_subtest "Search by to: (address)" add_message '[subject]="search by to (address)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [to]=searchbyto@example.com output=$(notmuch search to:searchbyto@example.com | notmuch_search_sanitize) @@ -97,6 +131,8 @@ thread:XXX 2009-11-18 [1/1] Stewart Smith; [notmuch] [PATCH] Fix linking with thread:XXX 2009-11-18 [2/2] Lars Kellogg-Stedman; [notmuch] \"notmuch help\" outputs to stderr? (attachment inbox unread) thread:XXX 2009-11-17 [1/1] Mikhail Gusarov; [notmuch] [PATCH] Handle rename of message file (inbox unread) thread:XXX 2009-11-17 [2/2] Alex Botero-Lowry, Carl Worth; [notmuch] preliminary FreeBSD support (attachment inbox unread) +thread:XXX 2001-01-05 [1/1] LWN.net Weekly Notification; LWN.net Weekly Edition for January 27, 2011 available (inbox unread) +thread:XXX 2001-01-05 [1/1] LWN.net Mailing Lists; LWN.net newly freed content for January 27, 2011 (inbox unread) thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (inbox unread) thread:XXX 2000-01-01 [1/1] searchbyfrom; search by from (inbox unread) thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unread) -- tg: (74cb76a..) t/from-lwn (depends on: master)