StatifierPersistence.Testing.Charts (StatifierPersistence v0.1.0)

Copy Markdown View Source

Tiny compiled charts for this package's own tests and for the conformance template (ADR-0003 decision 5).

Two SCXML sources, chart_a/0 and chart_b/0, differ by exactly one state so Statifier.Machine.Identity.of_source/2's content hash differs between them - the guard test needs a real recompiled revision, not a hand-forged identity struct, or it does not exercise what the guard exists to catch.

This module lives in lib/, not the test-only support/ directory, because Phase 4's conformance template also lives in lib/ (under this same StatifierPersistence.Testing.* namespace) and may not reference anything under test/ (ADR-0003 decision 5, st-ADR-0053's rule).

Summary

Functions

Compiles and returns chart "a" as {source, machine}.

Compiles and returns chart "b" as {source, machine}. Differs from chart_a/0 by one extra state, so its content hash differs.

Returns a compiled Machine.t() with its identity stripped.

Functions

chart_a()

@spec chart_a() :: {binary(), Statifier.Machine.t()}

Compiles and returns chart "a" as {source, machine}.

chart_b()

@spec chart_b() :: {binary(), Statifier.Machine.t()}

Compiles and returns chart "b" as {source, machine}. Differs from chart_a/0 by one extra state, so its content hash differs.

unidentified_machine()

@spec unidentified_machine() :: Statifier.Machine.t()

Returns a compiled Machine.t() with its identity stripped.

Statifier.Compiler.compile/1 takes a Statifier.Document.t(), not source bytes (deps/statifier/lib/statifier/compiler.ex:208), so the cheap way to build an unidentified machine in a test is this struct update on an already-compiled one, rather than driving the compiler pipeline by hand.