From 1dc69ee834d9ca9866969c1ad2e341797650bfb7 Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Sat, 22 Jun 2013 15:46:45 +1000 Subject: [PATCH] [PATCH v6 09/12] test: test insert --folder option --- 62/a76f0e0f7509c2d080ad9017a5212f682c72a1 | 96 +++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 62/a76f0e0f7509c2d080ad9017a5212f682c72a1 diff --git a/62/a76f0e0f7509c2d080ad9017a5212f682c72a1 b/62/a76f0e0f7509c2d080ad9017a5212f682c72a1 new file mode 100644 index 000000000..cbe1aacc2 --- /dev/null +++ b/62/a76f0e0f7509c2d080ad9017a5212f682c72a1 @@ -0,0 +1,96 @@ +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 A7A4E431FD6 + for ; Fri, 21 Jun 2013 22:48:16 -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 ckxeG0QUWFQA for ; + Fri, 21 Jun 2013 22:48:11 -0700 (PDT) +Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com + [209.85.220.42]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 6E0E8431FB6 + for ; Fri, 21 Jun 2013 22:47:41 -0700 (PDT) +Received: by mail-pa0-f42.google.com with SMTP id rl6so8790831pac.15 + for ; Fri, 21 Jun 2013 22:47:40 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=D7pXpe8OHnu2jofJFo6k5Qevrt9ddgvDcTwceFiZkUE=; + b=suVcvDZrfbSDzZwfiKw6MbKXd3hBnl1bykI2erL03+9LYsu7oJvDTFEb288yztZu/s + d4btpT6Rzlffp3kLCmEmPz612I2dn+Ykbc84scTWRAngZGyrv9fw11ZEnt/6RVLFfkT7 + abzIa6i8hvup2x37Bsk13MCdh7I7HV9vwS+KpGbX/XQeptC2ZORzGI7bXRqzJT9AUC3+ + TxYKWUnz1QMPtbNinZqAS2oIRvhrq444yujCMS0PN/Y3twQJfWS5+PEyDMy51u/bzkt1 + fEEt46XyaGcwmk6i/Jda+rPlI2LDQH2pKubvaF1vUDoeoeSPL/Ei8eBNBRJFpMQuM9xu + iHuw== +X-Received: by 10.66.179.78 with SMTP id de14mr19398929pac.18.1371880060722; + Fri, 21 Jun 2013 22:47:40 -0700 (PDT) +Received: from localhost (215.42.233.220.static.exetel.com.au. + [220.233.42.215]) by mx.google.com with ESMTPSA id + re16sm8900263pac.16.2013.06.21.22.47.38 for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Fri, 21 Jun 2013 22:47:40 -0700 (PDT) +From: Peter Wang +To: notmuch@notmuchmail.org +Subject: [PATCH v6 09/12] test: test insert --folder option +Date: Sat, 22 Jun 2013 15:46:45 +1000 +Message-Id: <1371880008-18312-10-git-send-email-novalazy@gmail.com> +X-Mailer: git-send-email 1.7.12.1 +In-Reply-To: <1371880008-18312-1-git-send-email-novalazy@gmail.com> +References: <1371880008-18312-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: Sat, 22 Jun 2013 05:48:16 -0000 + +Add tests for notmuch insert --folder option. +--- + test/insert | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/test/insert b/test/insert +index b432a74..f573c76 100755 +--- a/test/insert ++++ b/test/insert +@@ -77,4 +77,21 @@ notmuch insert +custom -unread < "$gen_msg_filename" + output=$(notmuch count tag:custom NOT tag:unread) + test_expect_equal "$output" "1" + ++test_begin_subtest "Insert message into folder" ++gen_insert_msg ++notmuch insert --folder=Drafts < "$gen_msg_filename" ++output=$(notmuch search --output=files folder:Drafts) ++dirname=$(dirname "$output") ++test_expect_equal "$dirname" "$MAIL_DIR/Drafts/cur" ++ ++test_begin_subtest "Insert message into folder, add/remove tags" ++gen_insert_msg ++notmuch insert --folder=Drafts +draft -unread < "$gen_msg_filename" ++output=$(notmuch count folder:Drafts tag:draft NOT tag:unread) ++test_expect_equal "$output" "1" ++ ++gen_insert_msg ++test_expect_code 1 "Insert message into non-existent folder" \ ++ "notmuch insert --folder=nonesuch < $gen_msg_filename" ++ + test_done +-- +1.7.12.1 + -- 2.26.2