Standard Library
std.assert
Assertion helpers for tests and runtime checks.
Exported functions
pub def ok(value)
Asserts that a value is truthy.
Examples
ok(1 + 1 == 2)
ok(x > 0)pub def eq(left, right)
Asserts that two values are equal.
Examples
eq(1 + 1, 2)
eq("hello", "hello")pub def ne(left, right)
Asserts that two values are not equal.
Examples
ne(1, 2)
ne("hello", "world")pub def snapshot(name, value, path)
Asserts that a value matches a saved snapshot.
Examples
snapshot("test_name", result)
snapshot("test_name", result, "custom/path")