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 5C3CF431E64
\r
6 for <notmuch@notmuchmail.org>; Thu, 24 Jan 2013 04:10:38 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 NGp83as4SlPY for <notmuch@notmuchmail.org>;
\r
17 Thu, 24 Jan 2013 04:10:36 -0800 (PST)
\r
18 Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com
\r
19 [209.85.160.53]) (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 7B3FB431FD6
\r
22 for <notmuch@notmuchmail.org>; Thu, 24 Jan 2013 04:10:14 -0800 (PST)
\r
23 Received: by mail-pb0-f53.google.com with SMTP id un1so4723223pbc.12
\r
24 for <notmuch@notmuchmail.org>; Thu, 24 Jan 2013 04:10:13 -0800 (PST)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to
\r
27 :references; bh=vn0tCk0YqrIc2URGHNKFhH7lltf38rbzXtMeSuIyHyI=;
\r
28 b=xmFjw/nx1Q0botyXms/DpvAFWqtNvuLLuDrbNh9+/ONH6Nc5hrpCdjA799C6KwOwtQ
\r
29 s19gg8efmWuLXF8vn3Iv86TBaLJWtdj+zEywx3aGjxS4XN7WDVNfaQFizCQATBssT2EA
\r
30 o3ePhYosb/bf4p7qYwe1pcfB5Difv34XyvbG2J9e2mnew+prFEUY9Jm9WqapH9g+atri
\r
31 KPV+W0vdqqFeB4cAtzoTm6QyqwoYW30czm2lyxuIJNWtnj+L0GmpA6HPqjB7BTLQqojE
\r
32 YHzJqg0NRdgv1Y09TYk3stPQkv/s/sVLYiu4VX71WyMGhX4ILvw3DqR9md4m4IxWnn4P
\r
34 X-Received: by 10.68.235.1 with SMTP id ui1mr4086703pbc.138.1359029413789;
\r
35 Thu, 24 Jan 2013 04:10:13 -0800 (PST)
\r
36 Received: from localhost (215.42.233.220.static.exetel.com.au.
\r
38 by mx.google.com with ESMTPS id l5sm13754412pax.10.2013.01.24.04.10.11
\r
39 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
40 Thu, 24 Jan 2013 04:10:13 -0800 (PST)
\r
41 From: Peter Wang <novalazy@gmail.com>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [PATCH v4 12/12] test: test insert --create-folder option
\r
44 Date: Thu, 24 Jan 2013 23:08:08 +1100
\r
45 Message-Id: <1359029288-12132-13-git-send-email-novalazy@gmail.com>
\r
46 X-Mailer: git-send-email 1.7.12.1
\r
47 In-Reply-To: <1359029288-12132-1-git-send-email-novalazy@gmail.com>
\r
48 References: <1359029288-12132-1-git-send-email-novalazy@gmail.com>
\r
49 X-BeenThere: notmuch@notmuchmail.org
\r
50 X-Mailman-Version: 2.1.13
\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: Thu, 24 Jan 2013 12:10:38 -0000
\r
63 Add tests for notmuch insert --create-folder option.
\r
65 test/insert | 24 ++++++++++++++++++++++++
\r
66 1 file changed, 24 insertions(+)
\r
68 diff --git a/test/insert b/test/insert
\r
69 index 44e071c..24a61e1 100755
\r
72 @@ -83,4 +83,28 @@ gen_insert_msg
\r
73 test_expect_code 1 "Insert message, non-existent folder" \
\r
74 "notmuch insert --folder=nonesuch < $gen_msg_filename"
\r
76 +test_begin_subtest "Insert message, create folder"
\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
83 +test_begin_subtest "Insert message, create subfolder"
\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
90 +test_begin_subtest "Insert message, create existing subfolder"
\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
97 +test_expect_code 1 "Insert message, create invalid subfolder" \
\r
98 + "notmuch insert --folder=../G --create-folder $gen_msg_filename"
\r