the caught throwable
AssertException otherwise
1 import std.exception : enforce; 2 3 auto exception = expectThrows(enforce(false)); 4 5 assertEquals("Enforcement failed", exception.msg);
auto exception = expectThrows!AssertException(expectThrows(42)); assertEquals("expected <Exception> was not thrown", exception.msg);
Asserts that the expression throws the specified throwable.