On Sat, Sep 07, 2013 at 11:52:10PM -0500, Felipe Contreras wrote:
> > Ah, you mean "if you think that the compare function should behave like
> > C *_cmp functions, it should be A-B". Perhaps it is simply that I do not
> > think of the function in those terms, but more like "show me the
> > differences from B to A".
> But that is the problem, you are unable to ignore the implementation.
> You don't see test_cmp(), you see 'diff -u'.
Yes, I already said earlier in the thread:
I certainly think of "test_cmp A B" as "differences from A to B", and
the order makes sense. IOW, the "test_cmp is diff" abstraction is
leaky, and that is fine (if it were not leaky, then order would not
matter at all, but it clearly does).
And I do not think it is a problem. The point of the function is not to
abstract away the idea of comparison. The point is to give a hook for
people on systems without "diff -u" to run the test suite.
> > John mentioned JUnit, NUnit, and PHPUnit earlier in the thread. I
> > believe that Ruby's Test::Unit::Assertions also has
> > assert_equal(expected, actual).
> That's because they all do first expect, then actual.
> assert_equal( expected, actual, failure_message = nil )
> assert_not_equal( expected, actual, failure_message = nil )
> That's why.
I do not see any reason why "not_equal" would not also work as
"assert_not_equal(actual, expected)". Maybe I am missing your point.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html