Unittests and assert

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Feb 28 09:39:22 PST 2013


On Thu, Feb 28, 2013 at 04:31:15PM +0100, Andrej Mitrovic wrote:
> On 2/28/13, H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:
> > Hmm. I was using assertNotThrown... which disappears with -release.
> 
> This shouldn't happen. Could you provide a test-case, I can't recreate
> this behavior.

Ugh. While trying to reduce the failing test case, I discovered that
assertNotThrown is actually working correctly. There appears to be some
kind of subtle bug in my code related to assert() being called in an
in-contract, that causes a side-effect that changes the result of the
test.

IOW, my fault, there's nothing wrong with assert/unittest. Sorry for the
false alarm. :-( :-(


T

-- 
All problems are easy in retrospect.


More information about the Digitalmars-d mailing list