Skip to content

Test package

This package provides test utilities.

{
  "type": "library"
}

Install

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

Test'Assert module

This module provides a collection of assertion logic for testing.

Types

No types are defined.

Functions

Equal

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

\(x any, y any) none | error

True

Assert that a condition is true.

\(x boolean) none | error

Error

Check if a value is an error.

\(x any) none | error

Fail

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

\() error

Test'State module

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

Types

State

A mutable state

type State {
  # ...
}

Functions

Run

Run a function with a state.

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

Get

Get a value from a state.

\(s State) any

Set

Set a value to a state.

\(s State, x any) none