# `Mutare.Result`
[🔗](https://github.com/foxbenjaminfox/mutare/blob/v0.5.1/lib/mutare/result.ex#L1)

The outcome of running the suite against one mutant.

# `selection`

```elixir
@type selection() :: Mutare.TestSelection.shape() | nil
```

Which tests a mutant's run covered: the whole `:suite`, its owning `:app` and that
app's dependents (a whole-suite run an umbrella narrowed), its covering test
`:files`, or the covering `:tests` within them (`Mutare.Runner.CoverageProbe`).
`nil` for a mutant that launched no run (`ran?/1` is false).

# `status`

```elixir
@type status() ::
  :killed
  | :survived
  | :no_coverage
  | :timeout
  | :atom_exhausted
  | :ignored
  | :poisoned
  | :harness_error
```

# `t`

```elixir
@type t() :: %Mutare.Result{
  duration_ms: non_neg_integer() | nil,
  exit_status: non_neg_integer() | nil,
  output: String.t() | nil,
  partition: pos_integer() | nil,
  selection: selection(),
  site: Mutare.Site.t(),
  status: status()
}
```

A mutant's result. `partition` is the partition its run used under `:partition_env`
(`--partition-db` or `--partition-env`), or `nil` when partitioning is off or no run
launched.

# `kill?`

```elixir
@spec kill?(status()) :: boolean()
```

Returns whether `status` counts as a killed mutant.

`:killed`, `:timeout`, and `:atom_exhausted` count as kills.

## Examples

    iex> Mutare.Result.kill?(:killed)
    true
    iex> Mutare.Result.kill?(:survived)
    false

# `ran?`

```elixir
@spec ran?(status()) :: boolean()
```

Returns whether a mutant launched a test run.

`:no_coverage`, `:ignored`, and `:poisoned` never start a test run.
`:harness_error` does start one and is included here.

## Examples

    iex> Mutare.Result.ran?(:harness_error)
    true
    iex> Mutare.Result.ran?(:ignored)
    false

# `scored?`

```elixir
@spec scored?(status()) :: boolean()
```

Returns whether `status` counts in the mutation-score denominator.

`:no_coverage`, `:ignored`, `:poisoned`, and `:harness_error` are excluded
because they do not produce a test-suite verdict for the mutation.

## Examples

    iex> Enum.filter(Mutare.Result.Status.names(), &Mutare.Result.scored?/1)
    [:killed, :timeout, :atom_exhausted, :survived]

---

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