# `Mix.Statifier.Corpus.Runner`
[🔗](https://github.com/riddler/statifier-ex/blob/v2.6.0/lib/mix/statifier/corpus/runner.ex#L1)

Runs corpus cases through statifier in the calling process's node, the way
a generated test module runs them: each case is one call to
`Statifier.Testing.Case.test_scxml/4` with the case's source, description,
initial configuration and steps, so a case agrees exactly when its
generated module would pass.

`test_scxml/4` asserts that the active leaf states statifier produces equal
the expected ones after initialization and after every step, so a case
that agrees has configurations that are what statifier produced; a case
that disagrees carries the assertion's own message. Cases run
concurrently, as the generated modules do (`async: true`); a case needing
a session (`<send>`, `<invoke>`, timers) needs the `:statifier`
application started, which `mix statifier.corpus` does before it runs any.

A case carrying a `host` object runs through
`Mix.Statifier.Corpus.HostCase` instead, which registers the case's send
types with the session it starts and compares the sends handed to them
with the case's `expect_sends` (ADR-0070 decision 5).

# `outcome`

```elixir
@type outcome() :: :agree | {:disagree, String.t()}
```

What running one case found.

# `run`

```elixir
@spec run(cases :: [map()]) :: [{String.t(), outcome()}]
```

Runs every case, returning `{id, outcome}` pairs in the order given.

# `run_case`

```elixir
@spec run_case(corpus_case :: map()) :: outcome()
```

Runs one case through `Statifier.Testing.Case.test_scxml/4`, or through
`Mix.Statifier.Corpus.HostCase.run/1` when it carries a `host` object.

---

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