The delegate that is expected to throw the exception.
The file name that the assert failed in. Should be left as default.
The file line that the assert failed in. Should be left as default.
If delegate does NOT throw, will throw an AssertError.
// Makes sure it throws, but does not check the message shouldThrow(delegate() { throw new Exception("boom!"); }); // Will throw an exception like "AssertError@test/example.d(7): Exception was not thrown. Expected one. shouldThrow(delegate() { });
Used for asserting that a delegate will throw an exception.