From: david Date: Fri, 16 Nov 2012 12:31:19 +0000 (+2000) Subject: [PATCH] test: add nontrivial test for restore --accumulate. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=3065903d909a0cbe01632afa090fcf82b30d6154;p=notmuch-archives.git [PATCH] test: add nontrivial test for restore --accumulate. --- diff --git a/5c/1a4cdabcf8e4a50db22beab4536162938ae668 b/5c/1a4cdabcf8e4a50db22beab4536162938ae668 new file mode 100644 index 000000000..9f5c543fe --- /dev/null +++ b/5c/1a4cdabcf8e4a50db22beab4536162938ae668 @@ -0,0 +1,98 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 7AA7B431FAF + for ; Fri, 16 Nov 2012 04:32:42 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 jzUROatlj3PV for ; + Fri, 16 Nov 2012 04:32:41 -0800 (PST) +Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id B2C6B431FBC + for ; Fri, 16 Nov 2012 04:32:41 -0800 (PST) +Received: from fctnnbsc30w-156034089108.dhcp-dynamic.fibreop.nb.bellaliant.net + ([156.34.89.108] helo=zancas.localnet) + by tesseract.cs.unb.ca with esmtpsa + (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) + (envelope-from ) + id 1TZL66-0000uO-Lv; Fri, 16 Nov 2012 08:32:39 -0400 +Received: from bremner by zancas.localnet with local (Exim 4.80) + (envelope-from ) + id 1TZL61-0006av-4u; Fri, 16 Nov 2012 08:32:33 -0400 +From: david@tethera.net +To: notmuch@notmuchmail.org +Subject: [PATCH] test: add nontrivial test for restore --accumulate. +Date: Fri, 16 Nov 2012 08:31:19 -0400 +Message-Id: <1353069079-25270-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.7.10.4 +X-Spam_bar: - +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: Fri, 16 Nov 2012 12:32:42 -0000 + +From: David Bremner + +It seems we have never tested the case that restore --accumulate +actually adds tags. I noticed this when I started optimizing and no +tests failed. + +I also had to modify the next test. Perhaps a seperate patch could +make these tests more independent of the previous ones. +--- + test/dump-restore | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/test/dump-restore b/test/dump-restore +index f25f7cf..ca7a730 100755 +--- a/test/dump-restore ++++ b/test/dump-restore +@@ -29,18 +29,20 @@ test_expect_success 'Accumulate original tags' \ + notmuch dump > dump.actual && + test_cmp dump-ABC_DEF.expected dump.actual' + +-test_expect_success 'Restoring original tags' \ +- 'notmuch restore --input=dump.expected && +- notmuch dump > dump.actual && +- test_cmp dump.expected dump.actual' +- + test_expect_success 'Restore with nothing to do' \ + 'notmuch restore < dump.expected && + notmuch dump > dump.actual && + test_cmp dump.expected dump.actual' + ++test_expect_success 'Accumulate with changes' \ ++ 'notmuch restore --input=dump.expected && ++ notmuch restore --accumulate --input=dump-ABC_DEF.expected && ++ notmuch dump > OUTPUT.$test_count && ++ test_cmp dump-ABC_DEF.expected OUTPUT.$test_count' ++ + test_expect_success 'Restore with nothing to do, II' \ +- 'notmuch restore --accumulate --input=dump.expected && ++ 'notmuch restore --input=dump.expected && ++ notmuch restore --accumulate --input=dump.expected && + notmuch dump > dump.actual && + test_cmp dump.expected dump.actual' + +-- +1.7.10.4 +