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 211BA431FB6 for ; Sun, 18 Dec 2011 05:15:43 -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 LebLwPHYBCP1 for ; Sun, 18 Dec 2011 05:15:41 -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 AC9D5429E26 for ; Sun, 18 Dec 2011 05:15:41 -0800 (PST) Received: from zancas.localnet (fctnnbsc36w-156034079193.pppoe-dynamic.High-Speed.nb.bellaliant.net [156.34.79.193]) (authenticated bits=0) by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id pBIDFdWr017888 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Sun, 18 Dec 2011 09:15:40 -0400 Received: from bremner by zancas.localnet with local (Exim 4.77) (envelope-from ) id 1RcGaZ-0008Rb-6j; Sun, 18 Dec 2011 09:15:39 -0400 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH Draft 2 9/9] test: add tests for restore --auto Date: Sun, 18 Dec 2011 09:15:11 -0400 Message-Id: <1324214111-32079-10-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1324214111-32079-1-git-send-email-david@tethera.net> References: <1324214111-32079-1-git-send-email-david@tethera.net> Cc: David Bremner 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: Sun, 18 Dec 2011 13:15:43 -0000 From: David Bremner We start by restoring the original tags, and making sure that restore worked. Next we test each possible input to autodetection, both explicit (with --format=auto) and implicit (without --format). --- test/dump-restore | 34 ++++++++++++++++++++++++++++++++-- 1 files changed, 32 insertions(+), 2 deletions(-) diff --git a/test/dump-restore b/test/dump-restore index ef4a63e..8400c7b 100755 --- a/test/dump-restore +++ b/test/dump-restore @@ -119,7 +119,6 @@ test_begin_subtest 'format=notmuch, round trip with strange tags' 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 |\ @@ -128,6 +127,37 @@ test_begin_subtest 'format=notmuch, checking encoded output' 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_begin_subtest 'restoring sane tags' + notmuch restore --format=notmuch < BACKUP + notmuch dump --format=notmuch > OUTPUT.$test_count +test_expect_equal_file BACKUP OUTPUT.$test_count + +test_begin_subtest 'format=notmuch, restore=auto' + notmuch dump --format=notmuch > EXPECTED.$test_count + notmuch tag -inbox -unread "*" + notmuch restore --format=auto < EXPECTED.$test_count + notmuch dump --format=notmuch > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest 'format=sup, restore=auto' + notmuch dump --format=sup > EXPECTED.$test_count + notmuch tag -inbox -unread "*" + notmuch restore --format=auto < EXPECTED.$test_count + notmuch dump --format=sup > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest 'format=notmuch, restore=default' + notmuch dump --format=notmuch > EXPECTED.$test_count + notmuch tag -inbox -unread "*" + notmuch restore < EXPECTED.$test_count + notmuch dump --format=notmuch > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest 'format=sup, restore=default' + notmuch dump --format=sup > EXPECTED.$test_count + notmuch tag -inbox -unread "*" + notmuch restore < EXPECTED.$test_count + notmuch dump --format=sup > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count test_done -- 1.7.7.3