"snoozing" with notmuch?
[notmuch-archives.git] / 50 / b26b48751479f5f5ced590da5d6f9af0a7af83
1 Return-Path: <novalazy@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 1D017431FCB\r
6         for <notmuch@notmuchmail.org>; Wed, 16 Apr 2014 06:01:14 -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.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, 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 SjFvwWG2n6Tt for <notmuch@notmuchmail.org>;\r
17         Wed, 16 Apr 2014 06:01:08 -0700 (PDT)\r
18 Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com\r
19         [209.85.220.50]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 65E1F429E31\r
22         for <notmuch@notmuchmail.org>; Wed, 16 Apr 2014 06:00:23 -0700 (PDT)\r
23 Received: by mail-pa0-f50.google.com with SMTP id kq14so10888609pab.37\r
24         for <notmuch@notmuchmail.org>; Wed, 16 Apr 2014 06:00:22 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26         h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
27         bh=FGaSSp021HjW1miPH50nvBPcHxxNW3ZM9Sd0efFSieI=;\r
28         b=fCfThf+DrJbE8Ybasu1Q0BNuoIQ92kX9D94K6qr4o0z/BOAlRknkTX9Y6ZJR0WYPvN\r
29         WBusXaxywLvOEaAg+oOntPHNNsEcFPDQDIUdNkkqIhHR0zlOzmJeStw7+2+Usnrf6HEx\r
30         t7tAzZLkmZLvwkQGVHXFmHianzswchRoi87bZ0FQCmegeWGFjkHHWAJ/LG94ZMSPwfTp\r
31         eJIvthC2UcWVeST7n8tSAQD8qxduRCQJ4V0KKKo1TCkKWYfPwUWBIAvcUhJB6TtY6anS\r
32         B7bTOcCsnyKlZDIku8RLJvg/KqTFawrH70KamTEn7VyGsRkBrtoHujmI3XU6kP+wFs94\r
33         D4eg==\r
34 X-Received: by 10.66.160.34 with SMTP id xh2mr8266146pab.109.1397653222700;\r
35         Wed, 16 Apr 2014 06:00:22 -0700 (PDT)\r
36 Received: from localhost (215.42.233.220.static.exetel.com.au.\r
37         [220.233.42.215]) by mx.google.com with ESMTPSA id\r
38         qx11sm110909430pab.35.2014.04.16.06.00.20 for <multiple recipients>\r
39         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
40         Wed, 16 Apr 2014 06:00:22 -0700 (PDT)\r
41 From: Peter Wang <novalazy@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH v2 09/10] test: test insert --must-index\r
44 Date: Wed, 16 Apr 2014 22:59:24 +1000\r
45 Message-Id: <1397653165-15620-10-git-send-email-novalazy@gmail.com>\r
46 X-Mailer: git-send-email 1.8.4\r
47 In-Reply-To: <1397653165-15620-1-git-send-email-novalazy@gmail.com>\r
48 References: <1397653165-15620-1-git-send-email-novalazy@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, 16 Apr 2014 13:01:14 -0000\r
62 \r
63 Test the insert --must-index option.\r
64 ---\r
65  test/T070-insert.sh | 28 +++++++++++++++++++++++++---\r
66  1 file changed, 25 insertions(+), 3 deletions(-)\r
67 \r
68 diff --git a/test/T070-insert.sh b/test/T070-insert.sh\r
69 index c576efc..4e289c0 100755\r
70 --- a/test/T070-insert.sh\r
71 +++ b/test/T070-insert.sh\r
72 @@ -21,11 +21,20 @@ gen_insert_msg() {\r
73  test_expect_code 2 "Insert zero-length file" \\r
74      "notmuch insert < /dev/null"\r
75  \r
76 -# This test is a proxy for other errors that may occur while trying to\r
77 -# add a message to the notmuch database, e.g. database locked.\r
78 -test_expect_code 0 "Insert non-message" \\r
79 +test_expect_code 3 "Insert non-message with --must-index on" \\r
80 +    "echo bad_message | notmuch insert --must-index"\r
81 +\r
82 +test_begin_subtest "Non-message file should not exist"\r
83 +output=$(find "${MAIL_DIR}/cur" "${MAIL_DIR}/new" "${MAIL_DIR}/tmp" -type f -print | wc -l)\r
84 +test_expect_equal "$output" "0"\r
85 +\r
86 +test_expect_code 0 "Insert non-message with --must-index off" \\r
87      "echo bad_message | notmuch insert"\r
88  \r
89 +test_begin_subtest "Non-message file should exist"\r
90 +output=$(find "${MAIL_DIR}/cur" "${MAIL_DIR}/new" "${MAIL_DIR}/tmp" -type f -print | wc -l)\r
91 +test_expect_equal "$output" "1"\r
92 +\r
93  test_begin_subtest "Database empty so far"\r
94  test_expect_equal "0" "`notmuch count --output=messages '*'`"\r
95  \r
96 @@ -77,6 +86,19 @@ notmuch insert +custom -unread < "$gen_msg_filename"\r
97  output=$(notmuch search --output=messages tag:custom NOT tag:unread)\r
98  test_expect_equal "$output" "id:$gen_msg_id"\r
99  \r
100 +# overlongtag exceeds NOTMUCH_TAG_MAX\r
101 +ten=0123456789\r
102 +hundred=${ten}${ten}${ten}${ten}${ten}${ten}${ten}${ten}${ten}${ten}\r
103 +overlongtag=x${hundred}${hundred}\r
104 +gen_insert_msg\r
105 +test_expect_code 3 "Tagging fails with --must-index on" \\r
106 +    "notmuch insert --must-index +$overlongtag < $gen_msg_filename"\r
107 +\r
108 +test_begin_subtest "Tagging fails with --must-index off"\r
109 +notmuch insert +$overlongtag < "$gen_msg_filename"\r
110 +output=$(notmuch search --output=messages id:$gen_msg_id)\r
111 +test_expect_equal "$output" "id:$gen_msg_id"\r
112 +\r
113  test_begin_subtest "Insert message with default tags stays in new/"\r
114  gen_insert_msg\r
115  notmuch insert < "$gen_msg_filename"\r
116 -- \r
117 1.8.4\r
118 \r