1 Return-Path: <jani@nikula.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 E6240431FCF
\r
6 for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 08:55:43 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id dJxGCtUqX7mS for <notmuch@notmuchmail.org>;
\r
17 Sun, 23 Feb 2014 08:55:39 -0800 (PST)
\r
18 Received: from mail-ee0-f51.google.com (mail-ee0-f51.google.com
\r
19 [74.125.83.51]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
20 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
21 073D1431FD9 for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 08:55:35 -0800
\r
23 Received: by mail-ee0-f51.google.com with SMTP id b57so2652078eek.38
\r
24 for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 08:55:34 -0800 (PST)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=1e100.net; s=20130820;
\r
27 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
\r
28 :references:in-reply-to:references;
\r
29 bh=g+FAkvWFq54bKweEwOXMY2ARDacnPy7bbFwYdZLAjWU=;
\r
30 b=QHCrFW4gCKbAO9QeCHpvsSQpqmSCb9H9YWmvbRZI1PYDlnn93f5F3CgqBD7XCjrLiK
\r
31 Jsp/JNV5PqXjib0QO2qzE37aufH9CMwbkC19IBVS1RuDhP4zuWoFZ8rVxQ534T1GCQD3
\r
32 OmQHoln4+ma8VtWR9ezallGutsmx9JQDyH0z1J98q7G4lFwe4NtaXWSGDlyd0zRCdLnM
\r
33 oxWwNHa71Xq5sTCfxjgAvyWqRikg8Xojxga6fl3BGAyOF6IJbLUiNytoU7JpXelIBbzW
\r
34 c/RDOB20oGTR3nGLrmajI2CopiaopD4jYAGm7e0EfzEPREIHSRDFa1Ka1NErabbGLEQF
\r
37 ALoCoQmoCsyVD2+zg+JjzjyiR3ewVp8bHFJKRz8mhPhhPBlerhTS0F3JWbaXO2uHlE7nLEYeFude
\r
38 X-Received: by 10.15.42.72 with SMTP id t48mr19825625eev.45.1393174534751;
\r
39 Sun, 23 Feb 2014 08:55:34 -0800 (PST)
\r
40 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.
\r
42 by mx.google.com with ESMTPSA id 46sm53043064ees.4.2014.02.23.08.55.33
\r
43 for <multiple recipients>
\r
44 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
45 Sun, 23 Feb 2014 08:55:34 -0800 (PST)
\r
46 From: Jani Nikula <jani@nikula.org>
\r
47 To: notmuch@notmuchmail.org,
\r
48 Rob Browning <rlb@defaultvalue.org>
\r
49 Subject: [PATCH 3/3] test: add tests for invalid new.tags
\r
50 Date: Sun, 23 Feb 2014 18:55:23 +0200
\r
52 <ca31c06691e8b922bac90560733aef735525a1ed.1393174108.git.jani@nikula.org>
\r
53 X-Mailer: git-send-email 1.8.5.3
\r
54 In-Reply-To: <cover.1393174108.git.jani@nikula.org>
\r
55 References: <87ha7qfto7.fsf@trouble.defaultvalue.org>
\r
56 <cover.1393174108.git.jani@nikula.org>
\r
57 In-Reply-To: <cover.1393174108.git.jani@nikula.org>
\r
58 References: <cover.1393174108.git.jani@nikula.org>
\r
59 X-BeenThere: notmuch@notmuchmail.org
\r
60 X-Mailman-Version: 2.1.13
\r
62 List-Id: "Use and development of the notmuch mail system."
\r
63 <notmuch.notmuchmail.org>
\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
67 List-Post: <mailto:notmuch@notmuchmail.org>
\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
71 X-List-Received-Date: Sun, 23 Feb 2014 16:55:44 -0000
\r
73 Similar tests for both notmuch new and insert.
\r
75 test/T050-new.sh | 17 +++++++++++++++++
\r
76 test/T070-insert.sh | 19 +++++++++++++++++++
\r
77 2 files changed, 36 insertions(+)
\r
79 diff --git a/test/T050-new.sh b/test/T050-new.sh
\r
80 index b7668ff0c4bc..ad46ee6d51b6 100755
\r
81 --- a/test/T050-new.sh
\r
82 +++ b/test/T050-new.sh
\r
83 @@ -263,4 +263,21 @@ notmuch search --format=text0 --output=files --offset=1 --limit=1 '*' | xargs -0
\r
84 output=$(NOTMUCH_NEW --quiet)
\r
85 test_expect_equal "$output" ""
\r
87 +OLDCONFIG=$(notmuch config get new.tags)
\r
89 +test_begin_subtest "Empty tags in new.tags are forbidden"
\r
90 +notmuch config set new.tags "foo;;bar"
\r
91 +output=$(NOTMUCH_NEW 2>&1)
\r
92 +test_expect_equal "$output" "Error: tag '' in new.tags: empty tag forbidden"
\r
94 +test_begin_subtest "Tags starting with '-' in new.tags are forbidden"
\r
95 +notmuch config set new.tags "-foo;bar"
\r
96 +output=$(NOTMUCH_NEW 2>&1)
\r
97 +test_expect_equal "$output" "Error: tag '-foo' in new.tags: tag starting with '-' forbidden"
\r
99 +test_expect_code 1 "Invalid tags set exit code" \
\r
100 + "NOTMUCH_NEW 2>&1"
\r
102 +notmuch config set new.tags $OLDCONFIG
\r
105 diff --git a/test/T070-insert.sh b/test/T070-insert.sh
\r
106 index e8dc4c099ed1..b77c5e13c87f 100755
\r
107 --- a/test/T070-insert.sh
\r
108 +++ b/test/T070-insert.sh
\r
109 @@ -164,4 +164,23 @@ gen_insert_msg
\r
110 test_expect_code 1 "Insert message, create invalid subfolder" \
\r
111 "notmuch insert --folder=../G --create-folder $gen_msg_filename"
\r
113 +OLDCONFIG=$(notmuch config get new.tags)
\r
115 +test_begin_subtest "Empty tags in new.tags are forbidden"
\r
116 +notmuch config set new.tags "foo;;bar"
\r
118 +output=$(notmuch insert $gen_msg_filename 2>&1)
\r
119 +test_expect_equal "$output" "Error: tag '' in new.tags: empty tag forbidden"
\r
121 +test_begin_subtest "Tags starting with '-' in new.tags are forbidden"
\r
122 +notmuch config set new.tags "-foo;bar"
\r
124 +output=$(notmuch insert $gen_msg_filename 2>&1)
\r
125 +test_expect_equal "$output" "Error: tag '-foo' in new.tags: tag starting with '-' forbidden"
\r
127 +test_expect_code 1 "Invalid tags set exit code" \
\r
128 + "notmuch insert $gen_msg_filename 2>&1"
\r
130 +notmuch config set new.tags $OLDCONFIG
\r