testThrown

Verifies that given expression throws exception instance of expected type.

void
testThrown
(
E : Exception = Exception
)
(
lazy void expr
,
bool strict = true
,
istring file = __FILE__
,
int line = __LINE__
)

Parameters

E

exception type to expect, Exception by default

expr void

expression that is expected to throw during evaluation

strict bool

if 'true', accepts only exact exception type, disallowing polymorphic conversion

file istring

file of origin

line int

line of origin

Throws

TestException if nothing has been thrown from expr Propagates any thrown exception which is not E In strict mode (default) also propagates any children of E (disables polymorphic catching)

Meta