Re: [PATCH] test: add nontrivial test for restore --accumulate.
authorEthan Glasser-Camp <ethan.glasser.camp@gmail.com>
Sat, 17 Nov 2012 01:56:37 +0000 (20:56 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:50:38 +0000 (09:50 -0800)
19/83843e568eb44a05d8a72c6f6010f5cd6f2114 [new file with mode: 0644]

diff --git a/19/83843e568eb44a05d8a72c6f6010f5cd6f2114 b/19/83843e568eb44a05d8a72c6f6010f5cd6f2114
new file mode 100644 (file)
index 0000000..ed80394
--- /dev/null
@@ -0,0 +1,123 @@
+Return-Path: <ethan.glasser.camp@gmail.com>\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 69A17431FAF\r
+       for <notmuch@notmuchmail.org>; Fri, 16 Nov 2012 17:56:50 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 VUvt9HKOOvx2 for <notmuch@notmuchmail.org>;\r
+       Fri, 16 Nov 2012 17:56:49 -0800 (PST)\r
+Received: from mail-qa0-f53.google.com (mail-qa0-f53.google.com\r
+       [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id A6D16431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 16 Nov 2012 17:56:49 -0800 (PST)\r
+Received: by mail-qa0-f53.google.com with SMTP id k31so2683577qat.5\r
+       for <notmuch@notmuchmail.org>; Fri, 16 Nov 2012 17:56:49 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+       :message-id:mime-version:content-type;\r
+       bh=USAOoY4ZA7NJJqtATXMtOonR5K+fESYTO+z7z6vc9wI=;\r
+       b=N31Bqzib1UEFfg3KRMoN5X9SRDQKkesThTAXjWm3wDosBApy8iHo9O8TfiwLknUBYt\r
+       McXFNVNJEy8MDAENDFuJR+cXqaf73yISNWpAslihVqH+rvQZlAv09rCnQtcDzueNME/X\r
+       7rCR06PeKgO/Ycvs956t+MCw92NG410BrObi6VjolkdLQdMvjuARe5Ty3lFb80KLFETM\r
+       fnp5DBBDq6lDDwmwAtmTKeVtoYaLTEVX2+yAK9aip80ulj3iSQK/Nh7kYXpxzAPc1RYT\r
+       SN+V5sk+FeFhd933WzBlOQW/4kH6MXJmvQHMB/BzTQABagADkEa2zKkB5v6VbP189n5n\r
+       p8Bw==\r
+Received: by 10.224.177.74 with SMTP id bh10mr6194587qab.65.1353117408083;\r
+       Fri, 16 Nov 2012 17:56:48 -0800 (PST)\r
+Received: from smtp.gmail.com ([66.114.71.21])\r
+       by mx.google.com with ESMTPS id d5sm1852494qev.2.2012.11.16.17.56.46\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 16 Nov 2012 17:56:46 -0800 (PST)\r
+From: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>\r
+To: david@tethera.net, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] test: add nontrivial test for restore --accumulate.\r
+In-Reply-To: <1353069079-25270-1-git-send-email-david@tethera.net>\r
+References: <1353069079-25270-1-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.14+45~g6ea9330 (http://notmuchmail.org) Emacs/24.1.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Fri, 16 Nov 2012 20:56:37 -0500\r
+Message-ID: <8762552dre.fsf@betacantrips.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+Cc: David Bremner <bremner@debian.org>\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: Sat, 17 Nov 2012 01:56:50 -0000\r
+\r
+david@tethera.net writes:\r
+\r
+> From: David Bremner <bremner@debian.org>\r
+>\r
+> It seems we have never tested the case that restore --accumulate\r
+> actually adds tags. I noticed this when I started optimizing and no\r
+> tests failed.\r
+>\r
+> I also had to modify the next test. Perhaps a seperate patch could\r
+> make these tests more independent of the previous ones.\r
+> ---\r
+>  test/dump-restore |   14 ++++++++------\r
+>  1 file changed, 8 insertions(+), 6 deletions(-)\r
+>\r
+> diff --git a/test/dump-restore b/test/dump-restore\r
+> index f25f7cf..ca7a730 100755\r
+> --- a/test/dump-restore\r
+> +++ b/test/dump-restore\r
+> @@ -29,18 +29,20 @@ test_expect_success 'Accumulate original tags' \\r
+>    notmuch dump > dump.actual &&\r
+>    test_cmp dump-ABC_DEF.expected dump.actual'\r
+>\r
+> -test_expect_success 'Restoring original tags' \\r
+> -  'notmuch restore --input=dump.expected &&\r
+> -  notmuch dump > dump.actual &&\r
+> -  test_cmp dump.expected dump.actual'\r
+> -\r
+\r
+I guess you're removing this test because it just shows that restore can\r
+remove tags, and we already see that in earlier tests?\r
+\r
+>  test_expect_success 'Restore with nothing to do' \\r
+>    'notmuch restore < dump.expected &&\r
+>    notmuch dump > dump.actual &&\r
+>    test_cmp dump.expected dump.actual'\r
+\r
+Maybe change the name of this test, as now it certainly does something?\r
+\r
+> +test_expect_success 'Accumulate with changes' \\r
+> +  'notmuch restore --input=dump.expected &&\r
+> +   notmuch restore --accumulate --input=dump-ABC_DEF.expected &&\r
+> +  notmuch dump >  OUTPUT.$test_count &&\r
+> +  test_cmp dump-ABC_DEF.expected OUTPUT.$test_count'\r
+\r
+Alignment? I think each line should start with two spaces.\r
+\r
+> +\r
+>  test_expect_success 'Restore with nothing to do, II' \\r
+> -  'notmuch restore --accumulate --input=dump.expected &&\r
+> +  'notmuch restore --input=dump.expected &&\r
+> +  notmuch restore --accumulate --input=dump.expected &&\r
+>    notmuch dump > dump.actual &&\r
+>    test_cmp dump.expected dump.actual'\r
+\r
+Maybe change the name? "Accumulate with nothing to do", for instance?\r
+\r
+Ethan\r