startest/expect

Assertions to be used in tests.

Functions

pub fn to_be_error(actual: Result(a, b)) -> b

Asserts that the given value is Error(_).

pub fn to_be_false(actual: Bool) -> Nil

Asserts that the given value is False.

pub fn to_be_none(actual: Option(a)) -> Nil

Asserts that the given value is None.

pub fn to_be_ok(actual: Result(a, b)) -> a

Asserts that the given value is Ok(_).

pub fn to_be_some(actual: Option(a)) -> a

Asserts that the given value is Some(_).

pub fn to_be_true(actual: Bool) -> Nil

Asserts that the given value is True.

pub fn to_equal(actual: a, expected expected: a) -> Nil

Asserts that the given value is equal to the expected value.

pub fn to_loosely_equal(
  actual: Float,
  expected expected: Float,
  tolerating tolerance: Float,
) -> Nil

Asserts that the given Float is equal to the expected Float within the provided tolerance.

pub fn to_not_equal(actual: a, expected expected: a) -> Nil

Asserts that the given value is not equal to the expected value.

pub fn to_not_throw(f: fn() -> a) -> a

Asserts that the given function does not throw an error.

pub fn to_throw(f: fn() -> a) -> Nil

Asserts that the given function throws an error.

Search Document