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 E9636431FB6 for ; Sun, 6 Feb 2011 05:21:21 -0800 (PST) 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 QRSKJcaaAMjX for ; Sun, 6 Feb 2011 05:21:21 -0800 (PST) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 4D168431FB5 for ; Sun, 6 Feb 2011 05:21:21 -0800 (PST) Received: by fxm11 with SMTP id 11so4321499fxm.26 for ; Sun, 06 Feb 2011 05:21:18 -0800 (PST) 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=d0131z31kNAUR261Pqa+Mxh7hJjMHHxZoUjrOrlkG2M=; b=lpEp5sPOLNdlB1cKrEBA3QLmS9NTjNl+WMwXUW53yTTAastRP04TzPqQpBmBbnxJ11 L/SMZhxtOwfZVTX5ZduJBTr6Wq9piju36ICIBlkIAWvoGRFhfl2rNHIZwjcpOl89jHEP KFodJjSARxMPLOg8yQ7dIQh01OaUZVYXVyID8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=gxCIq+hJplZ/IYnoEylbnyAudLdFnWvtt0u4xw8ANnhO4EVqtaeRz0sgeoLACwM5P0 XGlPoj/gERZUmZSEkl3ijFvQSEtDVfJcEUVjFZeLLsAedS1Bp/N6Q35LEdH/cp8EaZBt UrKCd5ItaXVQSC5D7mkdlDMyqSsjyKdmFE8fk= Received: by 10.223.115.75 with SMTP id h11mr13610916faq.119.1296998478424; Sun, 06 Feb 2011 05:21:18 -0800 (PST) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id c11sm839461fav.26.2011.02.06.05.21.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 06 Feb 2011 05:21:17 -0800 (PST) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH] test/search: add check for slightly trick search Date: Sun, 6 Feb 2011 15:21:13 +0200 Message-Id: <1296998473-13514-1-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.4.1.g4f7e4.dirty 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: Sun, 06 Feb 2011 13:21:22 -0000 It's not really tricky, there are many addresses with a '-' in them. I personally really want to differentiate between foo, foo-testing, and foo-patches. This fails, but it shouldn't: FAIL Search by from (tricky): --- search.17.expected 2011-02-06 13:16:31.871509560 +0000 +++ search.17.output 2011-02-06 13:16:31.871509560 +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; search by from (tricky trick) (inbox unread) thread:XXX 2000-01-01 [1/1] search-by-from; search by from (tricky) (inbox unread) 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..ad5bbaa 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' +add_message '[subject]="search by from (tricky)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[from]=search-by-from' +output=$(notmuch search from:'search-by-from' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] search-by-from; search by from (tricky) (inbox unread)" + test_done -- 1.7.4.1.g4f7e4.dirty