Skip to content

Test

This package provides test utilities.

{
"type": "library"
}
{
"dependencies": {
"Test": "pen:///test"
}
}

This module provides a collection of assertion logic for testing.

No types are defined.

Assert that values are equal. Also, if it finds values not comparable, it returns an error.

\(x any, y any) none | error

Assert that a condition is true.

\(x boolean) none | error

Check if a value is an error.

\(x any) none | error

Fail with an error immediately. This function is useful to make unreachable codes fail.

\() error

This module provides mutable states. They are useful to test certain kinds of side effects, such as I/O.

A mutable state

type State {
# ...
}

Run a function with a state.

\(f \(State) none | error) none | error

Get a value from a state.

\(s State) any

Set a value to a state.

\(s State, x any) none