= Assertions = ''Part of'' TutorialFundamentals == Description == If you can determine it's wrong at compile-time, why bother running it? If an assert evaluates to "false", the program terminates and an error message is displayed. == Example == {{{ #!d import std.stdio; void main() { writefln("Let's test some assertions..."); /* These assertions should succeed -- they evaluate to true. */ assert(true); assert('\xAA' == '\u00AA'); assert(221 % 5 == 1); assert(25 * 4 * 20 + 4 == 2004); /* This assertion fails... Error: AssertError Failure assert.d(line number) */ assert(false); writefln("No problem, man."); } }}} == More Information == See also the [http://www.digitalmars.com/d/expression.html#AssertExpression D Specification].