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 90F33431FDE for ; Wed, 14 Mar 2012 05:27:05 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.201 X-Spam-Level: X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=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 lwHLz+MZK7s1 for ; Wed, 14 Mar 2012 05:27:04 -0700 (PDT) Received: from mail-we0-f181.google.com (mail-we0-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 923D1431E62 for ; Wed, 14 Mar 2012 05:27:00 -0700 (PDT) Received: by mail-we0-f181.google.com with SMTP id m13so1833650wer.26 for ; Wed, 14 Mar 2012 05:27:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=eAfLpPLi+btolNoTM8riKGmtVfNmnSMl3+YVrF2eSlg=; b=dze+VTlCH9QSGW1PKrRLjmXogsaHzoi11yvtr682y/WTSd9wP4fg3+FoYlDL8TZvhZ bNos21uA/8/Fg8gLvgzMNyqpznk0wDc762tNxUbpWNwwqyvLG38iOiyn3eIsMibkzGRo F5Po+Y5i8798LCmxdtlLY/49KmHXQN6FbX2cLFJWHyWCSpD1yhY486tzXH4HXk+kNAo8 N5/62v74p8jvUMT1ObhU+JeTxlXKW9Nzi4g36gk6zySsq5p5BrxSt0Zyq36rUAHks0Gc 07TAP0i9C1MzncynghJpNOdmNJfKqGhFUyR3KXzmypmElH/dfUj9oeRklYIicIZXSNgo WxPg== Received: by 10.216.134.2 with SMTP id r2mr1535061wei.31.1331728020234; Wed, 14 Mar 2012 05:27:00 -0700 (PDT) Received: from localhost (94-192-233-223.zone6.bethere.co.uk. [94.192.233.223]) by mx.google.com with ESMTPS id gp8sm51515691wib.5.2012.03.14.05.26.58 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Mar 2012 05:26:59 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [Patch v2 2/3] test: add tests for message only search Date: Wed, 14 Mar 2012 12:26:53 +0000 Message-Id: <1331728014-32698-3-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1331728014-32698-1-git-send-email-markwalters1009@gmail.com> References: <1331728014-32698-1-git-send-email-markwalters1009@gmail.com> 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, 14 Mar 2012 12:27:06 -0000 This adds three tests for --output=messages searches. One test is for the case when one exclude tag does not occur in the Xapian database. This triggers a Xapian bug in some cases and causes the whole exclusion to fail. The next commit avoids this bug. --- test/search | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/test/search b/test/search index 3e3a462..17af6a2 100755 --- a/test/search +++ b/test/search @@ -132,13 +132,30 @@ test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; u test_begin_subtest "Exclude \"deleted\" messages from search" notmuch config set search.exclude_tags deleted generate_message '[subject]="Not deleted"' +not_deleted_id=$gen_msg_id generate_message '[subject]="Deleted"' notmuch new > /dev/null notmuch tag +deleted id:$gen_msg_id +deleted_id=$gen_msg_id output=$(notmuch search subject:deleted | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread) thread:XXX 2001-01-05 [0/1] Notmuch Test Suite; Deleted (deleted inbox unread)" +test_begin_subtest "Exclude \"deleted\" messages from message search" +output=$(notmuch search --output=messages subject:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "id:$not_deleted_id" + +test_begin_subtest "Exclude \"deleted\" messages from message search (no-exclude)" +output=$(notmuch search --no-exclude --output=messages subject:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "id:$not_deleted_id +id:$deleted_id" + +test_begin_subtest "Exclude \"deleted\" messages from message search (non-existent exclude-tag)" +notmuch config set search.exclude_tags deleted non_existent_tag +output=$(notmuch search --output=messages subject:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "id:$not_deleted_id" +notmuch config set search.exclude_tags deleted + test_begin_subtest "Exclude \"deleted\" messages from search, overridden" output=$(notmuch search subject:deleted and tag:deleted | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Deleted (deleted inbox unread)" -- 1.7.9.1