Re: [PATCH 0/4] Re: [PATCH 3/4] t: rev-parse-parents: avoid yoda conditions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 4, 2013, 17:38 UTC
- Message-ID
- <xmqq1u54o5c4.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20130904171356.GD2582@serenity.lan>
John Keeping <john@keeping.me.uk> writes:
Show 14 quoted lines
> On Wed, Sep 04, 2013 at 09:47:12AM -0700, Junio C Hamano wrote: >> Jonathan Nieder <jrnieder@gmail.com> writes: >> >> > test_cmp_rev follows the same order of arguments a "diff -u" and >> > produces the same output as plain "git diff". It's perfectly readable >> > and normal. >> >> This is way off tangent, but I am somewhat sympathetic to Felipe's >> "compare actual with expect", with reservations. > > This isn't an argument either way, but note that JUnit (and NUnit and > PHPUnit) all have assertEquals methods that take the arguments in the > order "expect, actual". I've always assumed that Git's test framework > was imitating that,...
No. See 82ebb0b6 (add test_cmp function for test scripts, 2008-03-12). The "test_cmp" was a replacement for "diff -u", and the same order we fed "diff -u", i.e. expect then actual, was carried over.