assert

Syntax

assert <expr>

or

assert <subCase>, <expr>

Arguments

subCase is a string. It can be specified without quotes.

expr is a Boolean value or expression.

Details

Mainly used for unit testing. It prints testing result only if the testing case fails.

Examples

@testing: case = "inner product"
// output
assert [1,2,3]**[4,5,6]==32;

assert [1,2,3]**[4,5,6]==33;
// output
Testing case inner product failed

assert 1==2;
// output
Testing case adhocTesting failed

@testing: case = "equal"
// output
assert "one", 1==2
assert "two", 3==4