throws(statement, ErrorType)

spir denis.spir at gmail.com
Sat Jan 22 20:11:44 PST 2011


How to write a predicate like:
	assert( throws(someStatement, ErrorType) );
?
Meaning a kind of builtin shortcut for:
	try:
	    someStatement;
	    throw new SomeCustomError();
	catch (ErrorType _) {}
that would also have the advantage of beeing usable as assert variant, 
unifying unittest checks. I constantly need that.

Denis
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d-learn mailing list