must-fail-with
Factor handbook » Developer tools » Unit testing

Prev:must-fail
Next:must-infer


Vocabulary
tools.test

Syntax
[ quot ] [ pred ] must-fail-with


Inputs
None

Outputs
None

Word description
Runs a quotation with an empty stack, expecting it to throw an error which must satisfy pred. If the quotation does not throw an error, or if the error does not match the predicate, the unit test fails.

Notes
This word is used to test error handling code, ensuring that errors thrown by code contain the relevant debugging information.

Definition