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 E6A4D431FB6 for ; Wed, 4 May 2011 14:56:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 cdpi+W03WHFi for ; Wed, 4 May 2011 14:56:06 -0700 (PDT) Received: from mail-ew0-f53.google.com (mail-ew0-f53.google.com [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 432A9431FB5 for ; Wed, 4 May 2011 14:56:06 -0700 (PDT) Received: by ewy8 with SMTP id 8so487360ewy.26 for ; Wed, 04 May 2011 14:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=tP2Ga6m7QXPNL4j4x3Q+3I4Sd+qOI09eVRX945Of9ck=; b=LRsD3Qiq/TuIyvdJNrOAF1FmmyLIvfY5Qq80F1i7lpiMhYUA4FM4653KldOSOeCscP SZH53FAopJGZKxCBm6HUHlYlHzsgNjL4dDlBaftNWqjAU3CW0+nmu4scs4jNLEw2G0LD 64Csaa5MiUwb8TE5Hp5j7OuV61e7amU1u80UI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=RmXylmDnvA+oLjuiwcF6zj3oK/M6i+lc7jln7YJNaaNW0vO5nV545Jt3zG6RBgbYS5 9hVULa4SSeUe3ixcNBzIIuvdCr+56pQ0xYjdH0J3gjA2fl75nTEhsd0RMXQVJ65n4lCk 3dp4pseXQg0gqy3xnChh+Y8yVJzyoxAfmQvlM= Received: by 10.14.22.70 with SMTP id s46mr824470ees.145.1304546164173; Wed, 04 May 2011 14:56:04 -0700 (PDT) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id y7sm4303eeh.19.2011.05.04.14.56.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 May 2011 14:56:03 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH v3] test/search: add check for slightly tricky search Date: Thu, 5 May 2011 00:55:58 +0300 Message-Id: <1304546158-15998-1-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.5 In-Reply-To: <20110504212636.GP29861@mit.edu> References: <20110504212636.GP29861@mit.edu> 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: Wed, 04 May 2011 21:56:07 -0000 It's not really tricky, there are many addresses with a '-' in them. I personally really want to differentiate between foo@bar.com, foo-testing@bar.com, and foo-patches@bar.com. This fails, but it shouldn't: FAIL Search by from (tricky): --- search.17.expected 2011-05-04 21:52:52.913218077 +0000 +++ search.17.output 2011-05-04 21:52:52.913218077 +0000 @@ -1 +1,3 @@ +thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread) +thread:XXX 2000-01-01 [1/1] search-by-from-trick@foo.com; search by from (tricky trick) (inbox unread) thread:XXX 2000-01-01 [1/1] search-by-from@foo.com; search by from (tricky) (inbox unread) One possibility to make this work is to translate @ to -at- in the database, so search-by-from@foo.com becomes search-by-from-trick-at-foo.com, therefore searching for search-by-from-at- would not be confused. Signed-off-by: Felipe Contreras --- test/search | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/test/search b/test/search index b180c7f..c6223f4 100755 --- a/test/search +++ b/test/search @@ -123,4 +123,10 @@ echo -n > expected && notmuch search "no-message-matches-this" > actual && test_cmp expected actual' +test_begin_subtest "Search by from (tricky):" +add_message '[subject]="search by from (tricky trick)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[from]=search-by-from-trick@foo.com' +add_message '[subject]="search by from (tricky)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[from]=search-by-from@foo.com' +output=$(notmuch search from:"search-by-from@" | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] search-by-from@foo.com; search by from (tricky) (inbox unread)" + test_done -- 1.7.5