Re: [PATCH v4 10/16] Add n_d_add_message_with_indexopts (extension of n_d_add_message)
[notmuch-archives.git] / 94 / ed6a28d3aa967d4ce7794d8ce90a660d258716
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 4AB30431FD4\r
6         for <notmuch@notmuchmail.org>; Sat, 22 Jun 2013 21:26:05 -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 1zmW-Q9MZY3d for <notmuch@notmuchmail.org>;\r
17         Sat, 22 Jun 2013 21:25:58 -0700 (PDT)\r
18 Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com\r
19         [209.85.160.47]) (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 9EA6B429E49\r
22         for <notmuch@notmuchmail.org>; Sat, 22 Jun 2013 21:24:58 -0700 (PDT)\r
23 Received: by mail-pb0-f47.google.com with SMTP id rr13so9537560pbb.20\r
24         for <notmuch@notmuchmail.org>; Sat, 22 Jun 2013 21:24:58 -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:x-mailer:in-reply-to:references;\r
27         bh=YPwR379/zV05Okgh5XP41HNIKRY8a0jyAtZZVJLMf7E=;\r
28         b=rtnBa9uBwEBN0Q58HzNzreIlIyDoV8td4EYBL0Dhgxif/hQgqSrHe9vGQcfh+q6bE/\r
29         dHgDILZaRCrJY6wW520pLRxKQxN0n3f1QGScr2oGbZqA/6YUWiwvqnL5HvsH5VKlPetl\r
30         8YePQrH9iQjhG+ZBuAkOT+gLChAqzGs5wt/D3hjZyXzzN2gT1ORBz7oJSmVqsTJwns8K\r
31         QGTceP23mNxUXnPzZYxEwHmv5BjBWPlWJ1LH2s7l/HIiVy195C+DiqchG247ayaMVopw\r
32         zt8E4YrUyKDaNCumqSGG0gbB2s0yXkbWuNwsc3s/jB1iZ6vxyuuBfD9hBWvp82TR+jN6\r
33         gg1Q==\r
34 X-Received: by 10.66.218.39 with SMTP id pd7mr22194494pac.148.1371961497947;\r
35         Sat, 22 Jun 2013 21:24:57 -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         bg3sm11814694pbb.44.2013.06.22.21.24.55 for <multiple recipients>\r
39         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
40         Sat, 22 Jun 2013 21:24:57 -0700 (PDT)\r
41 From: Peter Wang <novalazy@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH v7 12/12] test: test insert --create-folder option\r
44 Date: Sun, 23 Jun 2013 14:24:05 +1000\r
45 Message-Id: <1371961445-15182-13-git-send-email-novalazy@gmail.com>\r
46 X-Mailer: git-send-email 1.7.12.1\r
47 In-Reply-To: <1371961445-15182-1-git-send-email-novalazy@gmail.com>\r
48 References: <1371961445-15182-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: Sun, 23 Jun 2013 04:26:05 -0000\r
62 \r
63 Add tests for notmuch insert --create-folder option.\r
64 ---\r
65  test/insert | 24 ++++++++++++++++++++++++\r
66  1 file changed, 24 insertions(+)\r
67 \r
68 diff --git a/test/insert b/test/insert\r
69 index f573c76..021edb6 100755\r
70 --- a/test/insert\r
71 +++ b/test/insert\r
72 @@ -94,4 +94,28 @@ gen_insert_msg\r
73  test_expect_code 1 "Insert message into non-existent folder" \\r
74      "notmuch insert --folder=nonesuch < $gen_msg_filename"\r
75  \r
76 +test_begin_subtest "Insert message, create folder"\r
77 +gen_insert_msg\r
78 +notmuch insert --folder=F --create-folder +folder < "$gen_msg_filename"\r
79 +output=$(notmuch search --output=files folder:F tag:folder)\r
80 +basename=$(basename "$output")\r
81 +test_expect_equal_file "$gen_msg_filename" "$MAIL_DIR/F/cur/${basename}"\r
82 +\r
83 +test_begin_subtest "Insert message, create subfolder"\r
84 +gen_insert_msg\r
85 +notmuch insert --folder=F/G/H/I/J --create-folder +folder < "$gen_msg_filename"\r
86 +output=$(notmuch search --output=files folder:F/G/H/I/J tag:folder)\r
87 +basename=$(basename "$output")\r
88 +test_expect_equal_file "$gen_msg_filename" "${MAIL_DIR}/F/G/H/I/J/cur/${basename}"\r
89 +\r
90 +test_begin_subtest "Insert message, create existing subfolder"\r
91 +gen_insert_msg\r
92 +notmuch insert --folder=F/G/H/I/J --create-folder +folder < "$gen_msg_filename"\r
93 +output=$(notmuch count folder:F/G/H/I/J tag:folder)\r
94 +test_expect_equal "$output" "2"\r
95 +\r
96 +gen_insert_msg\r
97 +test_expect_code 1 "Insert message, create invalid subfolder" \\r
98 +    "notmuch insert --folder=../G --create-folder $gen_msg_filename"\r
99 +\r
100  test_done\r
101 -- \r
102 1.7.12.1\r
103 \r