Re: [PATCH] test: make test_expect_equal_file() arguments flexible
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Wed, 1 Feb 2012 09:19:31 +0000 (13:19 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:43:51 +0000 (09:43 -0800)
2e/36b8a69d5c020ad3793ba55702b9407bb0f1a4 [new file with mode: 0644]

diff --git a/2e/36b8a69d5c020ad3793ba55702b9407bb0f1a4 b/2e/36b8a69d5c020ad3793ba55702b9407bb0f1a4
new file mode 100644 (file)
index 0000000..49bfb37
--- /dev/null
@@ -0,0 +1,104 @@
+Return-Path: <dmitry.kurochkin@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 C1BDC431E64\r
+       for <notmuch@notmuchmail.org>; Wed,  1 Feb 2012 01:20:46 -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 1azBxmEmJtKT for <notmuch@notmuchmail.org>;\r
+       Wed,  1 Feb 2012 01:20:46 -0800 (PST)\r
+Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 05BE7431FAF\r
+       for <notmuch@notmuchmail.org>; Wed,  1 Feb 2012 01:20:45 -0800 (PST)\r
+Received: by bke11 with SMTP id 11so901115bke.26\r
+       for <notmuch@notmuchmail.org>; Wed, 01 Feb 2012 01:20:44 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+       :mime-version:content-type;\r
+       bh=H600vKT2fagxgcwkG1GZQp28qtdZNK1F9D0NHGxh/Uc=;\r
+       b=slKUfpPAUIdGL+iVqJFzU2/0AH2+yBbG/QtySXn8HJkP8SbogdjhlbhxID+Q3cDu/x\r
+       tcAvl6fPd38xCglPCeBWrR9KT5f4r7PMblOJv38aw8l8g6lFgRqHQUrgKjfOQT4cWktf\r
+       iNy+1yG9B7f6YK37OFIBt/1AFNbrCwLyH2nL0=\r
+Received: by 10.205.137.4 with SMTP id im4mr12725334bkc.136.1328088044615;\r
+       Wed, 01 Feb 2012 01:20:44 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id x20sm37315973bka.9.2012.02.01.01.20.43\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Wed, 01 Feb 2012 01:20:43 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: Jameson Graef Rollins <jrollins@finestructure.net>,\r
+ notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] test: make test_expect_equal_file() arguments flexible\r
+In-Reply-To: <87r4yfszx9.fsf@servo.finestructure.net>\r
+References: <1328080794-24670-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+       <87r4yfszx9.fsf@servo.finestructure.net>\r
+User-Agent: Notmuch/0.11+139~gd9b7cab (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Wed, 01 Feb 2012 13:19:31 +0400\r
+Message-ID: <87pqdync64.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\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: Wed, 01 Feb 2012 09:20:46 -0000\r
+\r
+On Wed, 01 Feb 2012 00:47:30 -0800, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
+> On Wed,  1 Feb 2012 11:19:54 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
+> > The down side of this approach is that diff argument order depends on\r
+> > test_expect_equal_file() argument order.  So sometimes we get diff\r
+> > from expected to actual results, and sometimes the other way around.\r
+> > But the files are always named correctly.\r
+> \r
+> Actually, I think this last point is the most important thing to retain.\r
+> Consistency in the diffs makes reading test results much more efficient.\r
+> The order I don't much care about.  But seeing as we have been\r
+> consistent with a particular order for a while, it seems like more\r
+> effort than it's worth to change it.\r
+> \r
+\r
+It is not true that we are consistent with test_expect_equal_file()\r
+argument order.  If we were, I would not bother.  The problem is we are\r
+not.  I remember that we already fixed argument order for\r
+test_expect_equal() and/or test_expect_equal_file().  If we do not solve\r
+this problem, we should make it a tradition.\r
+\r
+Consistent diff would be good.  But IMO the current situation is worse:\r
+we are *supposed* to have consistent diff output, but in reality we have\r
+messed diff output.\r
+\r
+Also please consider the following points:\r
+\r
+* Usually one is looking at a single failing test.  So it is not like\r
+  you have a series of inconsistent diffs.\r
+\r
+* I personally can not remember the argument and diff order.  So each\r
+  time I need to understand the diff, I look at the beginning to see\r
+  which side is where anyway.\r
+\r
+So IMHO diff order is not that important.  But I would like to see a\r
+better solution.  Perhaps Tomi's proposal would be the one.\r
+\r
+Regards,\r
+  Dmitry\r
+\r
+> jamie.\r