From 348927f7483d0162b0591eb9faf77ae1bf61c4cc Mon Sep 17 00:00:00 2001 From: david Date: Sun, 18 Nov 2012 10:30:31 +2000 Subject: [PATCH] [PATCH 2/2] test: add nontrivial test for restore --accumulate. --- 6d/9efb5808256487cb3a3c9a98e277f9f7ef16a0 | 89 +++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 6d/9efb5808256487cb3a3c9a98e277f9f7ef16a0 diff --git a/6d/9efb5808256487cb3a3c9a98e277f9f7ef16a0 b/6d/9efb5808256487cb3a3c9a98e277f9f7ef16a0 new file mode 100644 index 000000000..673048c74 --- /dev/null +++ b/6d/9efb5808256487cb3a3c9a98e277f9f7ef16a0 @@ -0,0 +1,89 @@ +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 9019E431FB6 + for ; Sat, 17 Nov 2012 06:35:31 -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 NSAfzGDEjQJq for ; + Sat, 17 Nov 2012 06:35:29 -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 CE228431FAE + for ; Sat, 17 Nov 2012 06:35:29 -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 1TZjSy-0000oU-Se; Sat, 17 Nov 2012 10:34:16 -0400 +Received: from bremner by zancas.localnet with local (Exim 4.80) + (envelope-from ) + id 1TZjPv-00024q-A4; Sat, 17 Nov 2012 10:30:43 -0400 +From: david@tethera.net +To: notmuch@notmuchmail.org +Subject: [PATCH 2/2] test: add nontrivial test for restore --accumulate. +Date: Sat, 17 Nov 2012 10:30:31 -0400 +Message-Id: <1353162631-7947-2-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1353162631-7947-1-git-send-email-david@tethera.net> +References: <8762552dre.fsf@betacantrips.com> + <1353162631-7947-1-git-send-email-david@tethera.net> +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: Sat, 17 Nov 2012 14:35:31 -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. + +The bracketing with "restore --input=dump.expected" are to make sure +we start in a known state, and we leave the database in a known state +for the next test. +--- + test/dump-restore | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/test/dump-restore b/test/dump-restore +index 7acf7fe..b05399c 100755 +--- a/test/dump-restore ++++ b/test/dump-restore +@@ -49,6 +49,13 @@ test_expect_success 'Accumulate with no tags' \ + notmuch dump > dump.actual && + test_cmp dump.expected dump.actual' + ++test_expect_success 'Accumulate with new tags' \ ++ 'notmuch restore --input=dump.expected && ++ notmuch restore --accumulate --input=dump-ABC_DEF.expected && ++ notmuch dump > OUTPUT.$test_count && ++ notmuch restore --input=dump.expected && ++ test_cmp dump-ABC_DEF.expected OUTPUT.$test_count' ++ + # notmuch restore currently only considers the first argument. + test_expect_success 'Invalid restore invocation' \ + 'test_must_fail notmuch restore --input=dump.expected another_one' +-- +1.7.10.4 + -- 2.26.2