Assert and the optional Message
Jacob Carlborg
doob at me.com
Sat Mar 10 07:43:46 PST 2012
On 2012-03-09 17:56, Jonathan M Davis wrote:
> It was never intended that AssertError or any other Error be particularly
> catchable, but it's also true that D is a systems programming language, so
> it'll let you do stuff which is unsafe, so if you know what you're doing, then
> there are circumstances where you can get away with (unit testing is one
> example of where catching AssertErrors might make sense). But you have to know
> what you're doing, since it's _not_ safe.
>
> - Jonathan M Davis
"might make sense". It makes perfectly sense to catch AssertErros in a
unit testing framework.
--
/Jacob Carlborg
More information about the Digitalmars-d-learn
mailing list