From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id B5C7C431FC3 for ; Sat, 22 Jun 2013 21:25:39 -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 YgEmQK6O63gD for ; Sat, 22 Jun 2013 21:25:33 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 43EC6429E32 for ; Sat, 22 Jun 2013 21:24:43 -0700 (PDT) Received: by mail-pb0-f50.google.com with SMTP id wz7so9575507pbc.37 for ; Sat, 22 Jun 2013 21:24:42 -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=Mt7T3Cvp647Go2LTD+dHODlcYTx2rzbgfcMrkLBgwbDRJFYUFRcZyDYJaGR8g9MmSq a5/CyVUwd57irGgSyj1yjrbYtYlYxzliigJM791NZ1CRn0hfFvR41c6CZol3KrtzelBn cIiEn+ep4r6vZ+nu4frE+4CMLqLhruFE8AehFkqjkdCB7kqJHedphjJMFyMrPsPrL3wv SRvKI8BCOBWmxHIh3CI1xXXuPgsdKmOMxutBrHvJ+u495vuw4O/3FHChSFCoNbCvloCq tX0mlVSaId5YdtBi/X6f6uNU9KS11VuHDymOlrlsfT3R6+Nm+OmBLSkueg35UKddMhv0 oySQ== X-Received: by 10.68.101.34 with SMTP id fd2mr18816399pbb.137.1371961482546; Sat, 22 Jun 2013 21:24:42 -0700 (PDT) Received: from localhost (215.42.233.220.static.exetel.com.au. [220.233.42.215]) by mx.google.com with ESMTPSA id o10sm11824455pbq.39.2013.06.22.21.24.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 22 Jun 2013 21:24:41 -0700 (PDT) From: Peter Wang To: notmuch@notmuchmail.org Subject: [PATCH v7 09/12] test: test insert --folder option Date: Sun, 23 Jun 2013 14:24:02 +1000 Message-Id: <1371961445-15182-10-git-send-email-novalazy@gmail.com> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1371961445-15182-1-git-send-email-novalazy@gmail.com> References: <1371961445-15182-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: Sun, 23 Jun 2013 04:25:39 -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