1 Return-Path: <amthrax@awakening.csail.mit.edu>
\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 EE690429E27
\r
6 for <notmuch@notmuchmail.org>; Mon, 7 Nov 2011 19:54:41 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 e-xwV5qHVo68 for <notmuch@notmuchmail.org>;
\r
16 Mon, 7 Nov 2011 19:54:41 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 67B34431FB6
\r
20 for <notmuch@notmuchmail.org>; Mon, 7 Nov 2011 19:54:41 -0800 (PST)
\r
21 X-AuditID: 12074424-b7ef76d0000008dc-1c-4eb8a80041bf
\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])
\r
23 by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 74.DC.02268.008A8BE4; Mon, 7 Nov 2011 22:54:40 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id pA83seC4030566;
\r
27 Mon, 7 Nov 2011 22:54:40 -0500
\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pA83sd8X007121
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Mon, 7 Nov 2011 22:54:39 -0500 (EST)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)
\r
35 (envelope-from <amthrax@awakening.csail.mit.edu>)
\r
36 id 1RNcoG-0006A6-1P; Mon, 07 Nov 2011 22:57:16 -0500
\r
37 From: Austin Clements <amdragon@MIT.EDU>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH] test: Add a test script for "notmuch tag"
\r
40 Date: Mon, 7 Nov 2011 22:57:11 -0500
\r
41 Message-Id: <1320724631-23643-1-git-send-email-amdragon@mit.edu>
\r
42 X-Mailer: git-send-email 1.7.7.1
\r
43 X-Brightmail-Tracker:
\r
44 H4sIAAAAAAAAA+NgFprJIsWRmVeSWpSXmKPExsUixG6nrsuwYoefwfYLVhbXb85kdmD0eLbq
\r
45 FnMAYxSXTUpqTmZZapG+XQJXxsWjF1gLZgpXrN2/l62B8Rt/FyMnh4SAicTcfc2sELaYxIV7
\r
46 69m6GLk4hAT2MUpM2r6cBcJZzyjxYc5SVgjnBJPE2sfrmUBahAQ2M0p83GoCYrMJaEhs27+c
\r
47 EcQWEZCW2Hl3NlADBwezgJrEny4VkLCwgJXE7XNXWUBsFgFViQtnT7KD2LwCDhITzxxjBCmX
\r
48 EFCQWLajegIj7wJGhlWMsim5Vbq5iZk5xanJusXJiXl5qUW65nq5mSV6qSmlmxjBIeCisoOx
\r
49 +ZDSIUYBDkYlHt6Zojv8hFgTy4orcw8xSnIwKYnyxi8FCvEl5adUZiQWZ8QXleakFh9ilOBg
\r
50 VhLhVWoCyvGmJFZWpRblw6SkOViUxHltdjr4CQmkJ5akZqemFqQWwWRlODiUJHiPLANqFCxK
\r
51 TU+tSMvMKUFIM3FwggznARp+EqSGt7ggMbc4Mx0if4pRUUqcV245UEIAJJFRmgfXC4vRV4zi
\r
52 QK8I8/4GaecBxjdc9yugwUxAg9t1t4EMLklESEk1MFY4lEXK7lLMqdp85asVY/5bDv9TDzpv
\r
53 KXfrTa1S3Grz7/RMlT3bRdiab/PuqVr2YbXebZ2DZ867W1iVVHsp29kdkVojxcWztajXhDsx
\r
54 XZTh0JyFlw/NdvqzzNWdpzP19L+1Vzc2nVz14Z+d2sx35vzPpq/0W3Jhf2v9P43njjFND36Z
\r
55 MctHJymxFGckGmoxFxUnAgAAl3IGrAIAAA==
\r
56 X-BeenThere: notmuch@notmuchmail.org
\r
57 X-Mailman-Version: 2.1.13
\r
59 List-Id: "Use and development of the notmuch mail system."
\r
60 <notmuch.notmuchmail.org>
\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
64 List-Post: <mailto:notmuch@notmuchmail.org>
\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
68 X-List-Received-Date: Tue, 08 Nov 2011 03:54:42 -0000
\r
71 This is, in principle, unrelated to the notmuch tag optimization I
\r
72 just sent out, though it does test some things that would be weird
\r
73 (though valid) to test if it weren't for that optimization.
\r
75 test/notmuch-test | 1 +
\r
76 test/tagging | 41 +++++++++++++++++++++++++++++++++++++++++
\r
77 2 files changed, 42 insertions(+), 0 deletions(-)
\r
78 create mode 100755 test/tagging
\r
80 diff --git a/test/notmuch-test b/test/notmuch-test
\r
81 index 738f8f6..bbabf28 100755
\r
82 --- a/test/notmuch-test
\r
83 +++ b/test/notmuch-test
\r
84 @@ -24,6 +24,7 @@ TESTS="
\r
86 search-position-overlap-bug
\r
87 search-insufficient-from-quoting
\r
92 diff --git a/test/tagging b/test/tagging
\r
93 new file mode 100755
\r
94 index 0000000..77202bf
\r
98 +#!/usr/bin/env bash
\r
99 +test_description='"notmuch tag"'
\r
102 +add_message '[subject]=One'
\r
103 +add_message '[subject]=Two'
\r
105 +test_begin_subtest "Adding tags"
\r
106 +notmuch tag +tag1 +tag2 +tag3 \*
\r
107 +output=$(notmuch search \* | notmuch_search_sanitize)
\r
108 +test_expect_equal "$output" "\
\r
109 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 tag2 tag3 unread)
\r
110 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag2 tag3 unread)"
\r
112 +test_begin_subtest "Removing tags"
\r
113 +notmuch tag -tag1 -tag2 \*
\r
114 +output=$(notmuch search \* | notmuch_search_sanitize)
\r
115 +test_expect_equal "$output" "\
\r
116 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag3 unread)
\r
117 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag3 unread)"
\r
119 +test_expect_code 1 "No tag operations" 'notmuch tag One'
\r
120 +test_expect_code 1 "No query" 'notmuch tag +tag2'
\r
122 +test_begin_subtest "Redundant tagging"
\r
123 +notmuch tag +tag1 -tag3 One
\r
124 +notmuch tag +tag1 -tag3 \*
\r
125 +output=$(notmuch search \* | notmuch_search_sanitize)
\r
126 +test_expect_equal "$output" "\
\r
127 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 unread)
\r
128 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 unread)"
\r
130 +test_begin_subtest "Special characters in tags"
\r
131 +notmuch tag +':" ' \*
\r
132 +notmuch tag -':" ' Two
\r
133 +output=$(notmuch search \* | notmuch_search_sanitize)
\r
134 +test_expect_equal "$output" "\
\r
135 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (:\" inbox tag1 unread)
\r
136 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 unread)"
\r