On Thursday, 16 October 2014 at 06:11:46 UTC, Jacob Carlborg wrote:
On 2014-10-15 16:25, Dicebot wrote:

How can one continue without recovering? This will result in any kind of environment not being cleaned and false failures of other tests that
share it.

I will probably use something else than "assert" in my unit tests. Something like assertEq, assertNotEq and so on. It's more flexible, can give better error message and I can have it throw an exception instead of an error. But there's still the problem with asserts in contracts and other parts of the code.

This is what we are using right now:

public void test ( char[] op, T1, T2 ) ( T1 a, T2 b, char[] file = __FILE__, size_t line = __LINE__ )
{
    enforce!(op, TestException)(a, b, file, line);
}

but it won't work well with 3d-party libraries that use assertions.

Reply via email to