Skip to main content

Crate ternlang_test

Crate ternlang_test 

Source
Expand description

ternlang-test — test framework for .tern programs.

Runs source strings through the full pipeline (parse → stdlib resolve → semantic check → codegen → BET VM) and asserts on the outcome.

§Quick start

assert_tern!(TernTestCase {
    name: "hold is the zero state",
    source: "fn main() -> trit { return 0; }",
    expected: TernExpected::Trit(0),
});

Macros§

assert_tern
Run a TernTestCase and panic with a readable message if it fails.

Structs§

TernTestCase
A single ternlang test case.
TernTestResult
Outcome of running a TernTestCase.

Enums§

TernExpected
What a test expects as its outcome.

Functions§

run_tern_test
Run a single test case through the complete ternlang pipeline and return a result indicating pass/fail with a diagnostic message.