notmuch search and tags
[notmuch-archives.git] / 31 / 4dd8a664d54408c4173437442b8d27d21c6565
1 Return-Path: <pieter@praet.org>\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 A81C9431FBD\r
6         for <notmuch@notmuchmail.org>; Thu, 23 Feb 2012 15:11:38 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 0uWhBW+XH-f8 for <notmuch@notmuchmail.org>;\r
16         Thu, 23 Feb 2012 15:11:38 -0800 (PST)\r
17 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
18         [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 18BE1431FAE\r
21         for <notmuch@notmuchmail.org>; Thu, 23 Feb 2012 15:11:37 -0800 (PST)\r
22 Received: by werp13 with SMTP id p13so1249384wer.26\r
23         for <notmuch@notmuchmail.org>; Thu, 23 Feb 2012 15:11:36 -0800 (PST)\r
24 Received-SPF: pass (google.com: domain of pieter@praet.org designates\r
25         10.181.13.113 as permitted sender) client-ip=10.181.13.113; \r
26 Authentication-Results: mr.google.com;\r
27         spf=pass (google.com: domain of pieter@praet.org\r
28         designates 10.181.13.113 as permitted sender)\r
29         smtp.mail=pieter@praet.org\r
30 Received: from mr.google.com ([10.181.13.113])\r
31         by 10.181.13.113 with SMTP id ex17mr762941wid.15.1330038696953\r
32         (num_hops = 1); Thu, 23 Feb 2012 15:11:36 -0800 (PST)\r
33 MIME-Version: 1.0\r
34 Received: by 10.181.13.113 with SMTP id ex17mr617719wid.15.1330038696886;\r
35         Thu, 23 Feb 2012 15:11:36 -0800 (PST)\r
36 Received: from localhost ([109.131.181.26])\r
37         by mx.google.com with ESMTPS id q2sm7375333wiy.7.2012.02.23.15.11.36\r
38         (version=TLSv1/SSLv3 cipher=OTHER);\r
39         Thu, 23 Feb 2012 15:11:36 -0800 (PST)\r
40 From: Pieter Praet <pieter@praet.org>\r
41 To: David Bremner <david@tethera.net>,\r
42         Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
43 Subject: [PATCH 2/6] test: emacs: new test "notmuch-show: change tags of all\r
44         messages in current buffer"\r
45 Date: Fri, 24 Feb 2012 00:09:10 +0100\r
46 Message-Id: <1330038554-10347-2-git-send-email-pieter@praet.org>\r
47 X-Mailer: git-send-email 1.7.8.1\r
48 In-Reply-To: <878vjtqhcg.fsf@praet.org>\r
49 References: <878vjtqhcg.fsf@praet.org>\r
50 X-Gm-Message-State:\r
51  ALoCoQnGRndMLgrXOsl5yEeA3KsBsDgu/w51CzB4g+Vn/jzNKMfGkaoCBpcU17ufBRXhZqijCbtg\r
52 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
53 X-BeenThere: notmuch@notmuchmail.org\r
54 X-Mailman-Version: 2.1.13\r
55 Precedence: list\r
56 List-Id: "Use and development of the notmuch mail system."\r
57         <notmuch.notmuchmail.org>\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
61 List-Post: <mailto:notmuch@notmuchmail.org>\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
65 X-List-Received-Date: Thu, 23 Feb 2012 23:11:38 -0000\r
66 \r
67 * test/emacs:\r
68 \r
69   New subtest "notmuch-show: change tags of all messages in current buffer":\r
70   `notmuch-show-tag-all' ("*") changes tags of *all* messages in current buffer.\r
71 ---\r
72  test/emacs |   15 +++++++++++++++\r
73  1 files changed, 15 insertions(+), 0 deletions(-)\r
74 \r
75 diff --git a/test/emacs b/test/emacs\r
76 index ec1dbb0..d2dbafc 100755\r
77 --- a/test/emacs\r
78 +++ b/test/emacs\r
79 @@ -136,6 +136,21 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\")\r
80  output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
81  test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
82  \r
83 +test_begin_subtest "notmuch-show: change tags of all messages in current buffer"\r
84 +query="$os_x_darwin_thread"\r
85 +filter="from:Jiang"\r
86 +add_tag="notmuch-show-tag-all"\r
87 +del_tag="inbox"\r
88 +count_total=$(notmuch count -- "$query")               # = 4\r
89 +count_match=$(notmuch count -- "$query" AND "$filter") # = 2\r
90 +test_emacs "(notmuch-search \"$query AND $filter\")\r
91 +        (notmuch-test-wait)\r
92 +        (notmuch-search-show-thread)\r
93 +        (execute-kbd-macro \"*+$add_tag -$del_tag\")"\r
94 +count_changed=$(notmuch count -- "$query" AND tag:"$add_tag" AND NOT tag:"$del_tag")\r
95 +notmuch tag +"$del_tag" -"$add_tag" -- "$query" # revert tag changes\r
96 +test_expect_equal "$count_changed" "$count_total" # assert that CHANGED == TOTAL\r
97 +\r
98  test_begin_subtest "Message with .. in Message-Id:"\r
99  add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'\r
100  test_emacs '(notmuch-search "id:\"123..456@example\"")\r
101 -- \r
102 1.7.8.1\r
103 \r