From aac5d6e295e94ea0d10a23361f3e832c32ae86bf Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Wed, 3 Apr 2013 09:41:57 +1100 Subject: [PATCH] [PATCH v5 12/12] test: test insert --create-folder option --- ef/f7a2f5c05fee0dd360dac3590ba749b9935dee | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 ef/f7a2f5c05fee0dd360dac3590ba749b9935dee diff --git a/ef/f7a2f5c05fee0dd360dac3590ba749b9935dee b/ef/f7a2f5c05fee0dd360dac3590ba749b9935dee new file mode 100644 index 000000000..cbd8ecdc6 --- /dev/null +++ b/ef/f7a2f5c05fee0dd360dac3590ba749b9935dee @@ -0,0 +1,103 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 47C72431FAF + for ; Tue, 2 Apr 2013 15:43:29 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 21S+r0YteapY for ; + Tue, 2 Apr 2013 15:43:27 -0700 (PDT) +Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com + [209.85.220.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id EF56B431FBC + for ; Tue, 2 Apr 2013 15:43:19 -0700 (PDT) +Received: by mail-pa0-f43.google.com with SMTP id hz11so548301pad.16 + for ; Tue, 02 Apr 2013 15:43:19 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to + :references; bh=vn0tCk0YqrIc2URGHNKFhH7lltf38rbzXtMeSuIyHyI=; + b=ojqEsUHodMjsSsWG6gaPEBtHkmagIeH8VkkcdFb2ernQ1YYcgdTV9N7kgrPqLb+kK1 + EUScP4tSxeVD6b94j097VbgH9Fqf4EOM4unylr0f++HmTNmbLzvaHEdSVS+Vx14wU7KD + vOxlZ35+DFC6mWa8+WWfTeADit5Upr9lNDIra9WincAG4w9wTeB3wA1qPpyTbEOWD4J5 + ZFk8lI+0PHeKo1/7xVuDlZVL5GFW+aGyMDtDqSuzXRpd5qbVIrv5b34UURMBRw0ojDNK + vd5WuhOIP6NKJDKmjBflLZJZThQHUjBQKcY79IW688rPsSjbtSyPp2LBmfncwZnioUjm + Aj6A== +X-Received: by 10.68.245.69 with SMTP id xm5mr26754278pbc.97.1364942599257; + Tue, 02 Apr 2013 15:43:19 -0700 (PDT) +Received: from localhost (215.42.233.220.static.exetel.com.au. + [220.233.42.215]) + by mx.google.com with ESMTPS id ql7sm3299777pbb.2.2013.04.02.15.43.16 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Tue, 02 Apr 2013 15:43:18 -0700 (PDT) +From: Peter Wang +To: notmuch@notmuchmail.org +Subject: [PATCH v5 12/12] test: test insert --create-folder option +Date: Wed, 3 Apr 2013 09:41:57 +1100 +Message-Id: <1364942517-6982-13-git-send-email-novalazy@gmail.com> +X-Mailer: git-send-email 1.7.12.1 +In-Reply-To: <1364942517-6982-1-git-send-email-novalazy@gmail.com> +References: <1364942517-6982-1-git-send-email-novalazy@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 02 Apr 2013 22:43:29 -0000 + +Add tests for notmuch insert --create-folder option. +--- + test/insert | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/test/insert b/test/insert +index 44e071c..24a61e1 100755 +--- a/test/insert ++++ b/test/insert +@@ -83,4 +83,28 @@ gen_insert_msg + test_expect_code 1 "Insert message, non-existent folder" \ + "notmuch insert --folder=nonesuch < $gen_msg_filename" + ++test_begin_subtest "Insert message, create folder" ++gen_insert_msg ++notmuch insert --folder=F --create-folder +folder < "$gen_msg_filename" ++output=$(notmuch search --output=files folder:F tag:folder) ++basename=$(basename "$output") ++test_expect_equal_file "$gen_msg_filename" "$MAIL_DIR/F/cur/${basename}" ++ ++test_begin_subtest "Insert message, create subfolder" ++gen_insert_msg ++notmuch insert --folder=F/G/H/I/J --create-folder +folder < "$gen_msg_filename" ++output=$(notmuch search --output=files folder:F/G/H/I/J tag:folder) ++basename=$(basename "$output") ++test_expect_equal_file "$gen_msg_filename" "${MAIL_DIR}/F/G/H/I/J/cur/${basename}" ++ ++test_begin_subtest "Insert message, create existing subfolder" ++gen_insert_msg ++notmuch insert --folder=F/G/H/I/J --create-folder +folder < "$gen_msg_filename" ++output=$(notmuch count folder:F/G/H/I/J tag:folder) ++test_expect_equal "$output" "2" ++ ++gen_insert_msg ++test_expect_code 1 "Insert message, create invalid subfolder" \ ++ "notmuch insert --folder=../G --create-folder $gen_msg_filename" ++ + test_done +-- +1.7.12.1 + -- 2.26.2