One file's metamutant (design notes §10.3, §10.4): its live mutants, how each is
switched (Juggernaut.Schemata.Site), the lifted functions
(Juggernaut.Schemata.Lift), the mutants taken out (with the reason) and the rendered
source with its span map.
Each unit owns a fixed block of switches, base..base + size - 1, so taking mutants out
of one file renumbers only that file and the others' rendered text stays the same (and
Mix does not recompile them). Within the block, sites are numbered in source order and
the mutants of one site consecutively, as Juggernaut.Peer.Switch.site/2 needs.
Inline sites whose ranges cross (rather than nest) cannot both be wrapped: the later one is lifted instead.
Summary
Functions
Takes the mutants with keys out of the unit, with reason.
The keys of the live mutants a list of switches names.
Poison isolation's step for the mutants with keys: an inline one is moved into a
lifted copy of its function (its site cannot take a case, as inside a macro's
argument, but the mutant alone may compile); a lifted one is taken out with reason.
Whether the unit's rendered source differs from the file as written.
The unit of file (its source and its mutants), with switches from base. Ignored
mutants are not compiled and are left out.
Renders the unit: assigns switches and writes the metamutant source and its span map. A lifted mutant whose copy cannot be written is taken out first.
The live mutants with their switches (after render/1).
Takes every live mutant out with reason: the file is compiled as written.
Types
@type entry() :: %{ mutant: Juggernaut.Mutant.t(), from: non_neg_integer(), to: non_neg_integer(), kind: :inline | {:lift, {module(), atom(), arity()}} }
@type t() :: %Juggernaut.Schemata.Unit{ base: pos_integer(), bisect: Juggernaut.Schemata.Bisect.state() | nil, bisected: non_neg_integer(), excluded: %{ required(String.t()) => %{mutant: Juggernaut.Mutant.t(), reason: String.t()} }, file: String.t(), functions: %{ required({module(), atom(), arity()}) => [ Juggernaut.Mutator.ModuleScan.clause() ] }, lifts: %{ required({module(), atom(), arity()}) => Juggernaut.Schemata.Lift.t() }, live: [entry()], rendered: binary() | nil, rounds: non_neg_integer(), sites: %{required(pos_integer()) => [pos_integer()]}, size: non_neg_integer(), spans: [Juggernaut.Schemata.Text.span()], switches: %{required(String.t()) => pos_integer()}, text: Juggernaut.Schemata.Text.t(), verbatim?: boolean() }
Functions
Takes the mutants with keys out of the unit, with reason.
@spec keys(t(), [pos_integer()]) :: [String.t()]
The keys of the live mutants a list of switches names.
Poison isolation's step for the mutants with keys: an inline one is moved into a
lifted copy of its function (its site cannot take a case, as inside a macro's
argument, but the mutant alone may compile); a lifted one is taken out with reason.
Whether the unit's rendered source differs from the file as written.
@spec new(String.t(), String.t(), [Juggernaut.Mutant.t()], pos_integer()) :: t()
The unit of file (its source and its mutants), with switches from base. Ignored
mutants are not compiled and are left out.
Renders the unit: assigns switches and writes the metamutant source and its span map. A lifted mutant whose copy cannot be written is taken out first.
@spec switched(t()) :: [Juggernaut.Mutant.t()]
The live mutants with their switches (after render/1).
Takes every live mutant out with reason: the file is compiled as written.