Test
This package provides test utilities.
{ "type": "library"}Install
Section titled “Install”{ "dependencies": { "Test": "pen:///test" }}Test'Assert module
Section titled “Test'Assert module”This module provides a collection of assertion logic for testing.
No types are defined.
Functions
Section titled “Functions”Assert that values are equal. Also, if it finds values not comparable, it returns an error.
\(x any, y any) none | errorAssert that a condition is true.
\(x boolean) none | errorCheck if a value is an error.
\(x any) none | errorFail with an error immediately. This function is useful to make unreachable codes fail.
\() errorTest'State module
Section titled “Test'State module”This module provides mutable states. They are useful to test certain kinds of side effects, such as I/O.
A mutable state
type State { # ...}Functions
Section titled “Functions”Run a function with a state.
\(f \(State) none | error) none | errorGet a value from a state.
\(s State) anySet a value to a state.
\(s State, x any) none