Skip to main content

Assert

Assert[test]

represents the assertion that test is True. If assertions have been enabled, test is evaluated when the assertion is encountered. If test is not True, then an assertion failure is generated.

Assert[test, tag]

specifies a tag that will be used to identify the assertion if it fails.

Debugging

Manual

Turn on warning messages

On[Assert]

Generate a failure

Assert[False]

Automatic

Use it together with Debugger to interrupt evaluation