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 37F20431FB6 for ; Wed, 4 May 2011 13:26:47 -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 JNqf+NlYdVda for ; Wed, 4 May 2011 13:26:46 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 43154431FB5 for ; Wed, 4 May 2011 13:26:46 -0700 (PDT) Received: by wyi11 with SMTP id 11so1225531wyi.26 for ; Wed, 04 May 2011 13:26:45 -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; bh=kiNNMn66G5odbC7rw/QVqA6cYx8jHFxxC5YlGlLPKNM=; b=EjTvW/FvE7AEV34DcErBsvbKtrJjRwK8hj0TBARw3sZuwnipJ8MIZ+pJSDkULkdzmU +jdeAUTZC6st9UsBRpnGYJ1ZvCzuKQ4LY3ZvQstfDH1MJu5VmkecBjScSmDMjCGkzleG HW/SHO/3bIOpwTwn5cVi9MyjjZ0VwT+yl8Vvc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=ecQ2gwpax0KkZP3YAs2yC6XafUHzhcOK0iRBMG5RzgA43RRiAM87WUqQXOwcFHsgra jfDiZZbSIBevnS6bUJVdD5WECxpKnseOcDdFLlvwaKPK/0GvtrrAtkI2QSTOIgC7FQqi PeuDRca/1/pwSQJDo83ZldWRvjNVRYyMIFlAU= Received: by 10.227.128.203 with SMTP id l11mr1649922wbs.79.1304540804666; Wed, 04 May 2011 13:26:44 -0700 (PDT) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id b6sm633020wby.62.2011.05.04.13.26.43 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 May 2011 13:26:43 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH v2] test/search: add check for slightly trick search Date: Wed, 4 May 2011 23:26:36 +0300 Message-Id: <1304540796-8865-1-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.5 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 20:26:47 -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 20:23:41.408279424 +0000 +++ search.17.output 2011-05-04 20:23:41.408279424 +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..4c7600e 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