# `StatifierPersistence.Testing.Charts`
[🔗](https://github.com/riddler/statifier_persistence/blob/v0.18.0/lib/statifier_persistence/testing/charts.ex#L1)

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).

# `chart_a`

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

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

# `chart_b`

```elixir
@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`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
