test module

Maylang standard-library module.

import "test" as test;

Module note — Assertions record failures and keep running. Call test_summary to fail the program when any assertion failed. Counters are shared module state.

Functions

check

may
fun check(condition: Bool, label: Str) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

assert_true

may
fun assert_true(condition: Bool, label: Str) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

assert_equal

may
fun assert_equal<T>(actual: T, expected: T, label: Str) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

assert_not_equal

may
fun assert_not_equal<T>(actual: T, unexpected: T, label: Str) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

assert_contains

may
fun assert_contains<T>(haystack: Any, needle: T, label: Str) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

assert_near

may
fun assert_near(actual: Float, expected: Float, tolerance: Float, label: Str) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

test_summary

may
fun test_summary() -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

Mutable constants

__passed

may
mut __passed: Int = 0;

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

__failed

may
mut __failed: Int = 0;

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source