Re: [PATCH] add has: query prefix to search for specific properties
[notmuch-archives.git] / ed / 519ec6b64b94ad091a2b74bcd40c1f307c9c11
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 8F6BB431FD2\r
6         for <notmuch@notmuchmail.org>; Tue, 24 Jul 2012 11:25:39 -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 LqXvZulCvelX for <notmuch@notmuchmail.org>;\r
18         Tue, 24 Jul 2012 11:25:38 -0700 (PDT)\r
19 Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com\r
20  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
21  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
22  2960C431FB6    for <notmuch@notmuchmail.org>; Tue, 24 Jul 2012 11:25:38 -0700\r
23  (PDT)\r
24 Received: by mail-wg0-f45.google.com with SMTP id dt14so5995257wgb.2\r
25         for <notmuch@notmuchmail.org>; Tue, 24 Jul 2012 11:25:37 -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=QJy4t4ksf8WaySTKWREcxMfI78PHMmerVlFsMsCXLO0=;\r
29         b=GaLzUlVqzpem0oEhyAkqtZmjW/odkFUBqzg8+xwax5hN31YiEk6O/fcEsNANn4MtHy\r
30         xTTXmm5vb+mcS/UI14hgsvtH3/HNNQMSLOwhrCbhs747V2gyDFVJIMODkD+FX+I8lz0U\r
31         zsp6ua/6J5vWBMzSfvhNEojLKAe03g+IN8VSa5Epn7L/PD52sc0HAv/+4AQJiCQTtiF6\r
32         gA0Nx4pd6VBYTo039IrDZGrgx0XMAVAeistx4SY/P9aqjqVJhwNgr8tdv0rxEwn+kjhw\r
33         FpECRlFqsloCT94NGgkaok6/EM+7m9RJ45gashXKr4B2tVaOUbKXTKg/fIxZhPqsGKF3\r
34         F2PQ==\r
35 Received: by 10.216.235.102 with SMTP id t80mr415075weq.87.1343154327554;\r
36         Tue, 24 Jul 2012 11:25:27 -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  y5sm5494691wiw.9.2012.07.24.11.25.26   (version=TLSv1/SSLv3 cipher=OTHER);     Tue,\r
40  24 Jul 2012 11:25:26 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH v2 (rebased) 2/4] test: add tests for the new\r
44         --body=true|false option\r
45 Date: Tue, 24 Jul 2012 19:23:28 +0100\r
46 Message-Id: <1343154210-26841-3-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <1343154210-26841-1-git-send-email-markwalters1009@gmail.com>\r
49 References: <1343154210-26841-1-git-send-email-markwalters1009@gmail.com>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Tue, 24 Jul 2012 18:25:39 -0000\r
63 \r
64 ---\r
65  test/json |    9 +++++++++\r
66  1 files changed, 9 insertions(+), 0 deletions(-)\r
67 \r
68 diff --git a/test/json b/test/json\r
69 index 337b3f5..831e105 100755\r
70 --- a/test/json\r
71 +++ b/test/json\r
72 @@ -7,6 +7,15 @@ add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:0\r
73  output=$(notmuch show --format=json "json-show-message")\r
74  test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]"\r
75  \r
76 +# This should be the same output as above.\r
77 +test_begin_subtest "Show message: json --body=true"\r
78 +output=$(notmuch show --format=json --body=true "json-show-message")\r
79 +test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]"\r
80 +\r
81 +test_begin_subtest "Show message: json --body=false"\r
82 +output=$(notmuch show --format=json --body=false "json-show-message")\r
83 +test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}}, []]]]"\r
84 +\r
85  test_begin_subtest "Search message: json"\r
86  add_message "[subject]=\"json-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-search-message\""\r
87  output=$(notmuch search --format=json "json-search-message" | notmuch_json_show_sanitize | notmuch_search_sanitize)\r
88 -- \r
89 1.7.9.1\r
90 \r