[Patch v2 2/3] test: add tests for message only search
authorMark Walters <markwalters1009@gmail.com>
Wed, 14 Mar 2012 12:26:53 +0000 (12:26 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:29 +0000 (09:45 -0800)
11/ceb0fecbe2f989e4d73e54cc6bae2e8d44fa84 [new file with mode: 0644]

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