[PATCH] test: make test_expect_equal_file() arguments flexible

Dmitry Kurochkin dmitry.kurochkin at gmail.com
Wed Feb 1 01:19:31 PST 2012


On Wed, 01 Feb 2012 00:47:30 -0800, Jameson Graef Rollins <jrollins at finestructure.net> wrote:
> On Wed,  1 Feb 2012 11:19:54 +0400, Dmitry Kurochkin <dmitry.kurochkin at gmail.com> wrote:
> > The down side of this approach is that diff argument order depends on
> > test_expect_equal_file() argument order.  So sometimes we get diff
> > from expected to actual results, and sometimes the other way around.
> > But the files are always named correctly.
> 
> Actually, I think this last point is the most important thing to retain.
> Consistency in the diffs makes reading test results much more efficient.
> The order I don't much care about.  But seeing as we have been
> consistent with a particular order for a while, it seems like more
> effort than it's worth to change it.
> 

It is not true that we are consistent with test_expect_equal_file()
argument order.  If we were, I would not bother.  The problem is we are
not.  I remember that we already fixed argument order for
test_expect_equal() and/or test_expect_equal_file().  If we do not solve
this problem, we should make it a tradition.

Consistent diff would be good.  But IMO the current situation is worse:
we are *supposed* to have consistent diff output, but in reality we have
messed diff output.

Also please consider the following points:

* Usually one is looking at a single failing test.  So it is not like
  you have a series of inconsistent diffs.

* I personally can not remember the argument and diff order.  So each
  time I need to understand the diff, I look at the beginning to see
  which side is where anyway.

So IMHO diff order is not that important.  But I would like to see a
better solution.  Perhaps Tomi's proposal would be the one.

Regards,
  Dmitry

> jamie.


More information about the notmuch mailing list