shouldThrowExactly

Verify that expr throws the templated Exception class. This only succeeds if the expression throws an exception of the exact type of the template parameter.

shouldThrowExactly
(
T : Throwable = Exception
E
)
(
lazy E expr
,
in string file = __FILE__
,
in size_t line = __LINE__
)

Return Value

Type: auto

The caught throwable.

Throws

UnitTestException on failure (when expr does not throw the expected exception)

Meta