[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-dev] First test "report"



On 12 Feb 2012, at 03:28, Nick Mathewson wrote:
>> 2. In comparison assertions, the general convention seems to be to place the
>> expected value first ("test_eq(0, functioncall(...))" rather than
>> "test_eq(functioncall(...), 0)"). I have modified the assertions not
>> following that convention, so they all look the same.
> 
> Hm.  I don't think we actually had a convention on this one.

It's not so important with tinytest because the output messages don't distinguish between expected and actual. In test frameworks where it does matter (e.g. JUnit) expected usually comes first in my experience. So I think the proposed convention is a good one and could be useful should we wish to change error messages to indicate the test failure message to say what was expected. I have found this feature of JUnit helpful, although by no means critical.

Steven. 
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev