std

module std::testingsource

Expectations for tests (LANGUAGE_SPEC.md section 6.5).

A test, test "name" { ... }, runs on its own under alloyc test; a failed expectation stops it. The compiler reports a panic here as test failed: <message>, where the test called into this module rather than the line inside it.

fn expectsource

exp fn expect(condition: bool)

Fails the test unless the condition holds.

fn expect_equalsource

exp fn expect_equal<T: Equal>(actual: &T, expected: &T)

Fails the test unless the values are equal, printing both when they declare Format (std::format), as numbers, bool and Strings do.

fn expect_equalsource

exp fn expect_equal(actual: &[u8], expected: &[u8])