[PATCH] test: Tests for combining --batch and --remove-all
authorDaniel Schoepe <daniel@schoepe.org>
Tue, 11 Aug 2015 08:02:16 +0000 (10:02 +0200)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:19 +0000 (14:49 -0700)
a3/16458f47f5a57b743fc02845cd024604d2c011 [new file with mode: 0644]

diff --git a/a3/16458f47f5a57b743fc02845cd024604d2c011 b/a3/16458f47f5a57b743fc02845cd024604d2c011
new file mode 100644 (file)
index 0000000..7b8ff41
--- /dev/null
@@ -0,0 +1,125 @@
+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 131DF6DE0B2F\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Aug 2015 01:03:12 -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 14Vrfa4YKukE for <notmuch@notmuchmail.org>;\r
+ Tue, 11 Aug 2015 01:03:09 -0700 (PDT)\r
+Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com\r
+ [209.85.212.179])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 0CB776DE0AC2\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Aug 2015 01:03:09 -0700 (PDT)\r
+Received: by wibhh20 with SMTP id hh20so183144776wib.0\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Aug 2015 01:03:07 -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=FroRYUll4p5Qp9tEv81+wtAX05m5InV1TnxITHVLnW0=;\r
+ b=K17SfHqKMRlQ4pUOsKC+vQusvTCf8X1p8J92fhTEE+rIEme7zuoMXIs40jZr7NkfvQ\r
+ tYOHJKTPO2wMOHoYbomhIcqGpzbvzs/COwt27N3FywuTbN6T60aRHCRA5QbWpdzOisWE\r
+ zMaRrphyRV54YqcSc88XWYcUvXKxK1WZ+BPL0=\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=FroRYUll4p5Qp9tEv81+wtAX05m5InV1TnxITHVLnW0=;\r
+ b=crHlgPrWI4ihm7nI5uaM3hRgEaE9HAtp42vDEcJzoZYztF3RnJ5FcG6FSEZxujGXC9\r
+ zqqSjNLwM73a5xWzLi2Hd8iOtuCC1axWSV3hZIqsGpf1w8aCCKsr5aDGCGE9ONyxiGMB\r
+ f3bRZnxNH4a5WyU/Kh/017b0XiPJYYdL3I4uXWbUjvtey1S6QMX9Mj0xEmudOnde4kAo\r
+ inNgQw9YGHezuJw8Qp+HFkNmqLUXtWkBi+0idW9H7M615m1fXkabm4WmxG4uIrzBlY2n\r
+ PN8be1hre8is/uxz8ZfaAkKGm5QUDiIJwYcBY+1EXAo3dtP06zLwCC19gOruhn0Kzqlu\r
+ UQrQ==\r
+X-Gm-Message-State:\r
+ ALoCoQldnY9HeBJoKciglmljw9lxHGVgkEmxQ/Az6WMchjNPdtpdpP2/TNxAbVPbCpaA7yIDNU+h\r
+X-Received: by 10.180.90.209 with SMTP id by17mr34426561wib.60.1439280187581; \r
+ Tue, 11 Aug 2015 01:03:07 -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 ny7sm17629936wic.11.2015.08.11.01.03.04\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Tue, 11 Aug 2015 01:03:06 -0700 (PDT)\r
+From: Daniel Schoepe <daniel@schoepe.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] test: Tests for combining --batch and --remove-all\r
+Date: Tue, 11 Aug 2015 10:02:16 +0200\r
+Message-Id: <1439280136-25465-2-git-send-email-daniel@schoepe.org>\r
+X-Mailer: git-send-email 2.5.0\r
+In-Reply-To: <1439280136-25465-1-git-send-email-daniel@schoepe.org>\r
+References: <id:1439279198-21330-3-git-send-email-daniel@schoepe.org>\r
+ <1439280136-25465-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 08:03:12 -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 | 25 +++++++++++++++++++++++++\r
+ 1 file changed, 25 insertions(+)\r
+\r
+diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh\r
+index 821d393..8adcabc 100755\r
+--- a/test/T150-tagging.sh\r
++++ b/test/T150-tagging.sh\r
+@@ -38,6 +38,17 @@ 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 +tag1 One\r
++notmuch tag --remove-all --batch <<EOF\r
++-- 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 ()\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 +113,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