Muex.Reporter.Patch (Muex v0.7.0)

View Source

Builds a compact before/after snippet for a mutation.

Reporters use this to show the actual code change introduced by each mutation, making survived or suspicious mutants easy to reproduce. Snippets are rendered from the mutation's :original_ast and :ast via Macro.to_string/1, falling back to inspect/1 for abstract code that the Elixir formatter cannot stringify (e.g. Erlang forms).

of/1 returns nil when the mutation does not carry both the original and mutated AST, so callers can omit the patch gracefully.

Summary

Functions

Returns a %{before: ..., after: ...} patch for a mutation.

Types

t()

@type t() :: %{before: String.t(), after: String.t()}

Functions

of(mutation)

@spec of(map()) :: t() | nil

Returns a %{before: ..., after: ...} patch for a mutation.

Returns nil when either :original_ast or :ast is missing.