On Mon, Oct 07, 2019 at 09:56:20PM +0200, Peter Eisentraut wrote: > On 2019-10-06 04:20, Noah Misch wrote: > > elog(ERROR, \ > > "%s yielded %u, expected %s (%u) in file \"%s\" line %u", \ > > #result_expr, result, #expected_expr, expected, __FILE__, __LINE__); \
> I've been meaning to propose some JUnit-style more-specific Assert > variants such as AssertEquals for this reason. But as Tom writes > nearby, it should be a straight wrapper around Assert, not elog. So > these need to be named separately. Agreed. > Btw., JUnit uses the ordering convention assertEquals(expected, actual), > whereas Perl Test::More uses is(actual, expected). Let's make sure we > pick something and stick with it. Since we write "if (actual == expected)", I prefer f(actual, expected). CUnit uses CU_ASSERT_EQUAL(actual, expected).