[PATCH 2/2] test: Tests for combining --batch and --remove-all
authorDaniel Schoepe <daniel@schoepe.org>
Tue, 11 Aug 2015 07:46:38 +0000 (09:46 +0200)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:19 +0000 (14:49 -0700)
c5/f6db91fa045c389e2682548f68c43dac4d44b1 [new file with mode: 0644]

diff --git a/c5/f6db91fa045c389e2682548f68c43dac4d44b1 b/c5/f6db91fa045c389e2682548f68c43dac4d44b1
new file mode 100644 (file)
index 0000000..3c2901d
--- /dev/null
@@ -0,0 +1,123 @@
+Return-Path: <daniel@schoepe.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id BC9C86DE02D6\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Aug 2015 00:47:31 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.11\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.11 tagged_above=-999 required=5 tests=[AWL=0.097, \r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
+ RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_WEB=0.614, SPF_PASS=-0.001]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id p0FyRYjmPQcA for <notmuch@notmuchmail.org>;\r
+ Tue, 11 Aug 2015 00:47:29 -0700 (PDT)\r
+Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com\r
+ [209.85.212.180])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 7D02C6DE179D\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Aug 2015 00:47:27 -0700 (PDT)\r
+Received: by wicja10 with SMTP id ja10so64505257wic.1\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Aug 2015 00:47:26 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schoepe.org; s=google;\r
+ h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+ bh=Xzk1weZX2lYeB3GjWvB/iEeHJ4XLvDqXaFlX47rv/ro=;\r
+ b=hE4c/aeK+uB3E9i0rWYS94NrRKPy1YRGApdWWrNZftsdT6hBzIGIoLxHlodhKI8x3P\r
+ QbkyB9wMzAVBpxlhuyI+ZRazJzY1pxgkgx5Tlyb2yLroqSwPgdLIc5bbzJYC5HYktiDt\r
+ S6kGG3IwYt7JboBMgpCo5s9lbnGIeqI+etRQc=\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+ :references;\r
+ bh=Xzk1weZX2lYeB3GjWvB/iEeHJ4XLvDqXaFlX47rv/ro=;\r
+ b=XrWUr1vPY0+I3tm5uzNZ5f+RzurrVH8j7i05fyVWMu8QteBeBDgRD8CL904AUyrpnO\r
+ 7wYPuQbpl8jwciKVkHvzl1MVkgL1qHB5cdfqyjF3Pf7/DcaeECtbOXbB8gIFJ7UWvf3Q\r
+ mLlW/VkERn0jfpB76z0o/lstLezzNvG/czVvG2DAxbrum3iurGfKG4HmdoXX+WxxXEqE\r
+ /LG0rUrqBVTnf0qldrJTlGlIVkxLbA5mJvsrUOtThr+iqo8V9IAfzxSVug/eDNF/31l2\r
+ VsS9gFjPBCm/yWpbPa2R3dYVs/RxOr4K7jfhSj556jrN6k7skTUEwU0RX+qzZxW03ear\r
+ 7fiw==\r
+X-Gm-Message-State:\r
+ ALoCoQm6WrCfEsRMyrNnV1IE8GCbbofwLCd1rL/PpkfmkdBW+8bOR74DIGTnDjff5RP1kNFM9EcK\r
+X-Received: by 10.180.75.48 with SMTP id z16mr33577937wiv.2.1439279245888;\r
+ Tue, 11 Aug 2015 00:47:25 -0700 (PDT)\r
+Received: from localhost (ip-80-226-24-7.vodafone-net.de. [80.226.24.7])\r
+ by smtp.gmail.com with ESMTPSA id w8sm2067732wiy.10.2015.08.11.00.47.23\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Tue, 11 Aug 2015 00:47:25 -0700 (PDT)\r
+From: Daniel Schoepe <daniel@schoepe.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] test: Tests for combining --batch and --remove-all\r
+Date: Tue, 11 Aug 2015 09:46:38 +0200\r
+Message-Id: <1439279198-21330-3-git-send-email-daniel@schoepe.org>\r
+X-Mailer: git-send-email 2.5.0\r
+In-Reply-To: <1439279198-21330-1-git-send-email-daniel@schoepe.org>\r
+References: <1439279198-21330-1-git-send-email-daniel@schoepe.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 11 Aug 2015 07:47:31 -0000\r
+\r
+This patch adds some tests for combining --remove-all with --batch or\r
+--input when calling notmuch-tag.\r
+---\r
+ test/T150-tagging.sh | 24 ++++++++++++++++++++++++\r
+ 1 file changed, 24 insertions(+)\r
+\r
+diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh\r
+index 821d393..19539dd 100755\r
+--- a/test/T150-tagging.sh\r
++++ b/test/T150-tagging.sh\r
+@@ -38,6 +38,16 @@ test_expect_equal "$output" "\\r
+ thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One ()\r
+ thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Two (tag5 tag6 unread)"\r
\r
++test_begin_subtest "Remove all with batch"\r
++notmuch tag --remove-all --batch <<EOF\r
+++tag1 -- One\r
+++tag3 +tag4 +inbox -- Two\r
++EOF\r
++output=$(notmuch search \* | notmuch_search_sanitize)\r
++test_expect_equal "$output" "\\r
++thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One (tag1)\r
++thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag3 tag4)"\r
++\r
+ test_begin_subtest "Remove all with a no-op"\r
+ notmuch tag +inbox +tag1 +unread One\r
+ notmuch tag --remove-all +foo +inbox +tag1 -foo +unread Two\r
+@@ -102,6 +112,20 @@ notmuch search \* | notmuch_search_sanitize > OUTPUT\r
+ notmuch restore --format=batch-tag < backup.tags\r
+ test_expect_equal_file batch.expected OUTPUT\r
\r
++test_begin_subtest "--batch --input --remove-all"\r
++notmuch dump --format=batch-tag > backup.tags\r
++notmuch tag +foo +bar -- One\r
++notmuch tag +tag7 -- Two\r
++notmuch tag --batch --input=batch.in --remove-all\r
++notmuch search \* | notmuch_search_sanitize > OUTPUT\r
++notmuch restore --format=batch-tag < backup.tags\r
++cat > batch_removeall.expected <<EOF\r
++thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One (@ tag6)\r
++thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Two (tag6)\r
++EOF\r
++test_expect_equal_file batch_removeall.expected OUTPUT\r
++rm batch_removeall.expected\r
++\r
+ test_begin_subtest "--batch, blank lines and comments"\r
+ notmuch dump | sort > EXPECTED\r
+ notmuch tag --batch <<EOF\r
+-- \r
+2.5.0\r
+\r