Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / 11 / ceb0fecbe2f989e4d73e54cc6bae2e8d44fa84
1 Return-Path: <markwalters1009@gmail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 90F33431FDE\r
6         for <notmuch@notmuchmail.org>; Wed, 14 Mar 2012 05:27:05 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id lwHLz+MZK7s1 for <notmuch@notmuchmail.org>;\r
18         Wed, 14 Mar 2012 05:27:04 -0700 (PDT)\r
19 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
20         [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 923D1431E62\r
23         for <notmuch@notmuchmail.org>; Wed, 14 Mar 2012 05:27:00 -0700 (PDT)\r
24 Received: by mail-we0-f181.google.com with SMTP id m13so1833650wer.26\r
25         for <notmuch@notmuchmail.org>; Wed, 14 Mar 2012 05:27:00 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
28         bh=eAfLpPLi+btolNoTM8riKGmtVfNmnSMl3+YVrF2eSlg=;\r
29         b=dze+VTlCH9QSGW1PKrRLjmXogsaHzoi11yvtr682y/WTSd9wP4fg3+FoYlDL8TZvhZ\r
30         bNos21uA/8/Fg8gLvgzMNyqpznk0wDc762tNxUbpWNwwqyvLG38iOiyn3eIsMibkzGRo\r
31         F5Po+Y5i8798LCmxdtlLY/49KmHXQN6FbX2cLFJWHyWCSpD1yhY486tzXH4HXk+kNAo8\r
32         N5/62v74p8jvUMT1ObhU+JeTxlXKW9Nzi4g36gk6zySsq5p5BrxSt0Zyq36rUAHks0Gc\r
33         07TAP0i9C1MzncynghJpNOdmNJfKqGhFUyR3KXzmypmElH/dfUj9oeRklYIicIZXSNgo\r
34         WxPg==\r
35 Received: by 10.216.134.2 with SMTP id r2mr1535061wei.31.1331728020234;\r
36         Wed, 14 Mar 2012 05:27:00 -0700 (PDT)\r
37 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
38  [94.192.233.223])      by mx.google.com with ESMTPS id\r
39  gp8sm51515691wib.5.2012.03.14.05.26.58 (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Wed, 14 Mar 2012 05:26:59 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [Patch v2 2/3] test: add tests for message only search\r
44 Date: Wed, 14 Mar 2012 12:26:53 +0000\r
45 Message-Id: <1331728014-32698-3-git-send-email-markwalters1009@gmail.com>\r
46 X-Mailer: git-send-email 1.7.9.1\r
47 In-Reply-To: <1331728014-32698-1-git-send-email-markwalters1009@gmail.com>\r
48 References: <1331728014-32698-1-git-send-email-markwalters1009@gmail.com>\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53         <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Wed, 14 Mar 2012 12:27:06 -0000\r
62 \r
63 This adds three tests for --output=messages searches. One test is for\r
64 the case when one exclude tag does not occur in the Xapian\r
65 database. This triggers a Xapian bug in some cases and causes the\r
66 whole exclusion to fail. The next commit avoids this bug.\r
67 ---\r
68  test/search |   17 +++++++++++++++++\r
69  1 files changed, 17 insertions(+), 0 deletions(-)\r
70 \r
71 diff --git a/test/search b/test/search\r
72 index 3e3a462..17af6a2 100755\r
73 --- a/test/search\r
74 +++ b/test/search\r
75 @@ -132,13 +132,30 @@ test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; u\r
76  test_begin_subtest "Exclude \"deleted\" messages from search"\r
77  notmuch config set search.exclude_tags deleted\r
78  generate_message '[subject]="Not deleted"'\r
79 +not_deleted_id=$gen_msg_id\r
80  generate_message '[subject]="Deleted"'\r
81  notmuch new > /dev/null\r
82  notmuch tag +deleted id:$gen_msg_id\r
83 +deleted_id=$gen_msg_id\r
84  output=$(notmuch search subject:deleted | notmuch_search_sanitize)\r
85  test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)\r
86  thread:XXX   2001-01-05 [0/1] Notmuch Test Suite; Deleted (deleted inbox unread)"\r
87  \r
88 +test_begin_subtest "Exclude \"deleted\" messages from message search"\r
89 +output=$(notmuch search --output=messages subject:deleted | notmuch_search_sanitize)\r
90 +test_expect_equal "$output" "id:$not_deleted_id"\r
91 +\r
92 +test_begin_subtest "Exclude \"deleted\" messages from message search (no-exclude)"\r
93 +output=$(notmuch search --no-exclude --output=messages subject:deleted | notmuch_search_sanitize)\r
94 +test_expect_equal "$output" "id:$not_deleted_id\r
95 +id:$deleted_id"\r
96 +\r
97 +test_begin_subtest "Exclude \"deleted\" messages from message search (non-existent exclude-tag)"\r
98 +notmuch config set search.exclude_tags deleted non_existent_tag\r
99 +output=$(notmuch search --output=messages subject:deleted | notmuch_search_sanitize)\r
100 +test_expect_equal "$output" "id:$not_deleted_id"\r
101 +notmuch config set search.exclude_tags deleted\r
102 +\r
103  test_begin_subtest "Exclude \"deleted\" messages from search, overridden"\r
104  output=$(notmuch search subject:deleted and tag:deleted | notmuch_search_sanitize)\r
105  test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Deleted (deleted inbox unread)"\r
106 -- \r
107 1.7.9.1\r
108 \r