Testing
Platform spec node
Testing
Spec standingStandard
No architecture decision records under adr/ for this feature yet. Standard features must
publish at least one ADR or keep a ## Decisions summary on the hub.
- Contracts Structural contract declarations, conformance lists, and embedding. Distinct from compiler Mod SDK contracts and from runtime requires/ensures (not in v0.1 grammar).
- Error handling Representing and propagating failures (`Result`, `try`, unwinding policy). Runtime lowering shares the ABI error envelope described in Execution.
- Testing The language-level test harness, discovery, and assertions users rely on. Corelib testing helpers extend but do not redefine these semantics.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
scope | yes | yes |
features | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Normative specification
Section titled “Normative specification”Defines the test item, discovery metadata, and skip rules for language-level tests. Harness execution is realized by tooling and corelib helpers.
Syntax
Section titled “Syntax”test MyCase { meta { timeout = 30; } // statements}test Name { body }declares a test entry point; the identifier is followed directly by the test body block (no parameter list).meta { key = expr; }sections attach metadata (timeouts, categories) parsed asTestMetaSection.skip { key = expr; }sections mark conditional skip predicates.
Static rules
Section titled “Static rules”- Test bodies must contain only statements and meta/skip sections allowed by
TestBodyItem. - Tests may appear in Test project kinds; placement in App/Lib projects should warn per manifest policy.
- Attributes on tests follow the general attribute rules (E1508–E1510).
Dynamic semantics
Section titled “Dynamic semantics”- The test runner must invoke each discovered test entrypoint in isolation unless
metaspecifies shared fixtures (future). - Failed assertions must report as test failures without undefined behavior.
- Skipped tests must not count as failures when skip predicates evaluate true.
Diagnostics
Section titled “Diagnostics”Attribute and visibility issues use E15xx; test-specific codes may be added in the registry band reserved for tooling.
Conformance
Section titled “Conformance”beskid test (tooling) must discover all test items in Test projects matching this syntax.
Decisions
Section titled “Decisions”- D-LM-TST-001 — First-class
testitem: Tests are module items, not attributes on functions only. - D-LM-TST-002 — meta/skip blocks: Structured sections replace ad hoc comment conventions.
- D-LM-TST-003 — Test project kind: Discovery should scope to
Testprojects unless manifest policy allows otherwise. - D-LM-TST-004 — Corelib helpers are additive: Assertion helpers in corelib must not redefine language-level
testsyntax.
Platform view
Section titled “Platform view”The language-level test harness, discovery, and assertions users rely on. Corelib testing helpers extend but do not redefine these semantics.