Function assert

pub fn assert(
    condition: bool,
    message: Option<EcoString>,
) -> Result<NoneValue, EcoString>
Expand description

Ensures that a condition is fulfilled.

Fails with an error if the condition is not fulfilled. Does not produce any output in the document.

If you wish to test equality between two values, see [assert.eq] and [assert.ne].

ยงExample

#assert(1 < 2, message: "math broke")