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 97081431FAE for ; Thu, 24 Jan 2013 04:10:07 -0800 (PST) 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 PyhBLxUJtjyx for ; Thu, 24 Jan 2013 04:10:05 -0800 (PST) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id C5526431FDB for ; Thu, 24 Jan 2013 04:09:59 -0800 (PST) Received: by mail-pa0-f44.google.com with SMTP id hz11so5463313pad.31 for ; Thu, 24 Jan 2013 04:09:59 -0800 (PST) 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=cxDsnDrvNG3VLmMlXpW4HjF9n69aOLUvC7UC4Jv7wzs=; b=Z9+Db27xwBL71va9z13hLscbcwOkaz3T6RqiswxZFQS6qppm7TnphFQmsKF+qiHq/b WHESshR9FCKz3H8i9nn4ZBZWO3NRNSY1eDQdAF4Fl75u+8i7hkj8lqHitKcw4LuGkE3R bXq/UTfSk/DHAZwpP7nEKIBNXXUnslE3u4qkb4fqHVsKvqwsvf2P3jkOUaA+CMuR6vvY IqTr99PGWOdvw0rvo+yY9AqrLtca7/WjIDggItcLRdKzdNvokGAaJZFrP4q/acB+tNNE MvxDZOFMhOxdGSX1DRVQ1/OWZhO4bZ3XSxWcoOMzJnwXCkJ7oU/1p+1kClWgg7zCtft7 U97g== X-Received: by 10.66.84.10 with SMTP id u10mr4156219pay.24.1359029399041; Thu, 24 Jan 2013 04:09:59 -0800 (PST) Received: from localhost (215.42.233.220.static.exetel.com.au. [220.233.42.215]) by mx.google.com with ESMTPS id i6sm15601989paw.19.2013.01.24.04.09.57 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 24 Jan 2013 04:09:58 -0800 (PST) From: Peter Wang To: notmuch@notmuchmail.org Subject: [PATCH v4 09/12] test: test insert --folder option Date: Thu, 24 Jan 2013 23:08:05 +1100 Message-Id: <1359029288-12132-10-git-send-email-novalazy@gmail.com> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1359029288-12132-1-git-send-email-novalazy@gmail.com> References: <1359029288-12132-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: Thu, 24 Jan 2013 12:10:08 -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 d880af9..44e071c 100755 --- a/test/insert +++ b/test/insert @@ -66,4 +66,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, 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, folder and 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, non-existent folder" \ + "notmuch insert --folder=nonesuch < $gen_msg_filename" + test_done -- 1.7.12.1