unittest vs exceptions?

Maxime Chevalier maximechevalierb at gmail.com
Sat Aug 4 15:00:24 PDT 2012


I'd like to write some unit tests to check my software. Writing 
unittest blocks and putting assert statements in there seems easy 
enough, but I noticed that if the code I run in there throws an 
exception, I don't get the unit test failed message.

How does unittest check for success/failure? Does assert throw a 
special kind of error class when it fails? How would you check 
that some code didn't throw an exception, or did throw an 
exception?


More information about the Digitalmars-d-learn mailing list