assert x prints an error message if x isn't true.
i1 : stopIfError = false; |
i2 : assert( (2+2) === 4) |
i3 : assert(rank matrix {{1, 2}, {2, 4}} == 2) stdio:3:1:(3): error: assertion failed |
If x is an Expression that evaluates to false, then a partially evaluated form is printed with the error message to assist in debugging.
i4 : assert Equation(rank matrix {{1, 2}, {2, 4}}, 2) stdio:4:1:(3): error: assertion failed: 1 == 2 is false |
The object assert is a method function.