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