Skip to main content

Crate fallow_mutation

Crate fallow_mutation 

Source
Expand description

Mutant site discovery and mutation-switching instrumentation.

The crate is pure: it reads one source text and returns the mutants and the instrumented text. It does no IO, and it depends on no other Fallow workspace crate. The engine joins the mutants to graph, diff and complexity facts.

The instrumented text is a splice over the original text. The crate never reprints the AST, so the output keeps the language of the input (TypeScript stays TypeScript, JSX stays JSX) and runner transforms see the original syntax.

Two rules can give the same replacement at the same span, for example the relational constant true of a === b and the negate-condition mutant of a === b as an operand of &&. The site keeps the first candidate that the selected operators allow, so each mutated text is one mutant.

User documentation is on fallow mutation.

Structs§

FunctionRef
The function that contains a mutant.
Instrumented
The result of instrument.
Mutant
One mutant.
MutantChange
The edit of a mutant without project text.
MutantId
The stable identity of a mutant: 16 lowercase hex digits.
MutationOptions
Options for instrument.
ScriptBlock
One script block of a component file.
SpliceMap
Maps instrumented byte offsets back to original byte offsets.
SpliceSegment
One copied run of original text in the instrumented output.

Enums§

MutationError
An error from instrument.
Operator
One mutation operator.
ScriptRole
The role of a script block in a component file.
SourceKind
The language of a source text.

Constants§

ACTIVE_FUNCTION
The prelude function that asks the runtime whether a mutant is active.
HIT_FUNCTION
The prelude function that reports a hit on the original branch.
RESERVED_PREFIX
The name prefix that the instrumentation reserves.

Functions§

export_containing
The name of the export whose declaration holds span, for example the function of a mutant. A mutant in a nested function gives the export of the outer function. default names a default export. A class or an object literal that holds the function is not a function to call, so it gives None.
instrument
Finds the mutants in source and returns the instrumented text.
instrument_blocks
Finds the mutants in the script blocks of a component file and returns the instrumented file.