[Alpha PATCH 6/6] test: second set of dump/restore --format=notmuch tests
authorDavid Bremner <david@tethera.net>
Tue, 13 Dec 2011 20:27:55 +0000 (16:27 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:49 +0000 (09:40 -0800)
5b/5da2bffb5251b340a168ada867188237052cd2 [new file with mode: 0644]

diff --git a/5b/5da2bffb5251b340a168ada867188237052cd2 b/5b/5da2bffb5251b340a168ada867188237052cd2
new file mode 100644 (file)
index 0000000..043b292
--- /dev/null
@@ -0,0 +1,104 @@
+Return-Path: <bremner@pivot.cs.unb.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 725CB429E28\r
+       for <notmuch@notmuchmail.org>; Tue, 13 Dec 2011 12:28:21 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id t9ABxSsYa35W for <notmuch@notmuchmail.org>;\r
+       Tue, 13 Dec 2011 12:28:20 -0800 (PST)\r
+Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 3556A429E29\r
+       for <notmuch@notmuchmail.org>; Tue, 13 Dec 2011 12:28:18 -0800 (PST)\r
+Received: from convex-new.cs.unb.ca ([131.202.13.154])\r
+       by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id pBDKSA6t002930;\r
+       Tue, 13 Dec 2011 16:28:10 -0400\r
+Received: from bremner by convex-new.cs.unb.ca with local (Exim 4.72)\r
+       (envelope-from <bremner@pivot.cs.unb.ca>)\r
+       id 1RaYxO-0001xW-Gy; Tue, 13 Dec 2011 16:28:10 -0400\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Alpha PATCH 6/6] test: second set of dump/restore --format=notmuch\r
+       tests\r
+Date: Tue, 13 Dec 2011 16:27:55 -0400\r
+Message-Id: <1323808075-7417-7-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <1323808075-7417-1-git-send-email-david@tethera.net>\r
+References: <1323808075-7417-1-git-send-email-david@tethera.net>\r
+Cc: David Bremner <bremner@debian.org>, pere@hungry.com\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\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, 13 Dec 2011 20:28:22 -0000\r
+\r
+From: David Bremner <bremner@debian.org>\r
+\r
+These one need the completed functionality in notmuch-restore. Fairly\r
+exotic tags are tested, but no weird message id's.\r
+---\r
+ test/dump-restore |   33 +++++++++++++++++++++++++++++++++\r
+ 1 files changed, 33 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/dump-restore b/test/dump-restore\r
+index 48caf4e..122de5c 100755\r
+--- a/test/dump-restore\r
++++ b/test/dump-restore\r
+@@ -94,4 +94,37 @@ notmuch dump --format=sup -- from:cworth | tr -d \(\) > EXPECTED.$test_count\r
+ notmuch dump --format=notmuch -- from:cworth > OUTPUT.$test_count\r
+ test_expect_equal_file OUTPUT.$test_count EXPECTED.$test_count\r
\r
++test_begin_subtest "format=notmuch, # round-trip"\r
++notmuch dump --format=sup | sort > EXPECTED.$test_count\r
++notmuch dump --format=notmuch | notmuch restore --format=notmuch\r
++notmuch dump --format=sup | sort > OUTPUT.$test_count\r
++test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count\r
++\r
++tag1='comic_swear=$&^%$^%\\//-+$^%$'\r
++enc1=$($TEST_DIRECTORY/hex-xcode e "$tag1")\r
++\r
++tag2=$(printf 'this\n tag\t has\n spaces')\r
++enc2=$($TEST_DIRECTORY/hex-xcode e "$tag2")\r
++\r
++notmuch dump --format=notmuch > BACKUP\r
++\r
++notmuch tag +"$tag1" +"$tag2" -inbox -unread "*"\r
++\r
++test_begin_subtest 'format=notmuch, round trip with strange tags'\r
++   notmuch dump --format=notmuch > EXPECTED.$test_count\r
++   notmuch dump --format=notmuch | notmuch restore --format=notmuch\r
++   notmuch dump --format=notmuch > OUTPUT.$test_count\r
++test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count\r
++\r
++\r
++test_begin_subtest 'format=notmuch, checking encoded output'\r
++    cp /dev/null EXPECTED.$test_count\r
++    notmuch dump --format=notmuch -- from:cworth |\\r
++       awk "{ print \$1 \" $enc1 $enc2\" }" > EXPECTED.$test_count\r
++\r
++    notmuch dump --format=notmuch -- from:cworth  > OUTPUT.$test_count\r
++test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count\r
++\r
++notmuch restore --format=notmuch < BACKUP\r
++\r
+ test_done\r
+-- \r
+1.7.5.4\r
+\r