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 D84F5431FAF for ; Wed, 25 Jul 2012 06:45:01 -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 B8Vtbd4tefDU for ; Wed, 25 Jul 2012 06:45:01 -0700 (PDT) Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com [209.85.160.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 105D7431FAE for ; Wed, 25 Jul 2012 06:45:00 -0700 (PDT) Received: by mail-pb0-f53.google.com with SMTP id rr13so1767731pbb.26 for ; Wed, 25 Jul 2012 06:45:00 -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=i8ZJbrNG2t/t6McYsVnkr+27c5tF4OzAyXYy4BlXy1E=; b=B7vZZ6f6SpmfdIaG8L4thk9NbblL1TlYBNXZVugpaXuBPNO94ZJxUa0JkYvTmcAulC 0bqgW2CCxIDaXgrx+EWKW/xhLpHK30smhhWJyZwcNrr3vuxg/imilr1PITZISzGwkUa1 RS0uEJj6VBgleNHx6CrKBl4S37Net4Ogvt1GESmUWiCHzpELKqNR4SysPEYwBYvx/7c5 2N2tAjn63ci58ed7ZeIle+JJ3VaAaxhh+WDOf3Shxc+NDMRjIZ7iTez4cVE3KsHUVuu1 9JiSxJpNc9k9JFlfbI4DSOaRPw43C4PYOufXcnPIQdXnBmle4MibwGbuTRLvqNQwh/fw Icvw== Received: by 10.68.231.233 with SMTP id tj9mr53601528pbc.39.1343223900863; Wed, 25 Jul 2012 06:45:00 -0700 (PDT) Received: from localhost (215.42.233.220.static.exetel.com.au. [220.233.42.215]) by mx.google.com with ESMTPS id ot4sm14408033pbb.65.2012.07.25.06.44.58 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jul 2012 06:45:00 -0700 (PDT) From: Peter Wang To: notmuch@notmuchmail.org Subject: [PATCH 18/18] test: test insert --create-folder Date: Wed, 25 Jul 2012 23:42:47 +1000 Message-Id: <1343223767-9812-18-git-send-email-novalazy@gmail.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1343223767-9812-1-git-send-email-novalazy@gmail.com> References: <1343223767-9812-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: Wed, 25 Jul 2012 13:45:02 -0000 Add tests for the new option. --- test/insert | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/test/insert b/test/insert index 3514920..548da58 100755 --- a/test/insert +++ b/test/insert @@ -50,4 +50,28 @@ generate_message \ notmuch insert --folder=Drafts -- +draft -unread < "$gen_msg_filename" test_expect_equal "`notmuch count folder:Drafts tag:draft NOT tag:unread`" "1" +test_begin_subtest "Insert message, create folder" +generate_message \ + "[subject]=\"insert-subject-createfolder\"" \ + "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" \ + "[body]=\"insert-message-createfolder\"" +notmuch insert --folder=F --create-folder -- +folder < "$gen_msg_filename" +test_expect_equal "`notmuch count folder:F tag:folder`" "1" + +test_begin_subtest "Insert message, create subfolder" +generate_message \ + "[subject]=\"insert-subject-createfolder\"" \ + "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" \ + "[body]=\"insert-message-createfolder\"" +notmuch insert --folder=F/G/H/I/J --create-folder -- +folder < "$gen_msg_filename" +test_expect_equal "`notmuch count folder:F/G/H/I/J tag:folder`" "1" + +test_begin_subtest "Insert message, create existing subfolder" +generate_message \ + "[subject]=\"insert-subject-createfolder\"" \ + "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" \ + "[body]=\"insert-message-createfolder\"" +notmuch insert --folder=F/G/H/I/J --create-folder -- +folder < "$gen_msg_filename" +test_expect_equal "`notmuch count folder:F/G/H/I/J tag:folder`" "2" + test_done -- 1.7.4.4