Hello all,

Some unittests I've been writing for Phobos involve using assertThrown!AssertError to check that assert failures are indeed triggered where they should be.

Surprise surprise, this fails on the release unittest build, because of course the assertion statements are stripped out. I assumed that using version(assert) { ... } to surround the assertThrown statement would fix this, but it doesn't -- the assertThrown keeps being called and keeps claiming that no AssertError was thrown.

I guess I could do version(release) {} { assertThrown(...); } but that seems kind of ugly. Any alternatives?

Thanks & best wishes,

    -- Joe

Reply via email to