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.

Subsumption is a static rule: negate-condition gives no mutant for a test that is a comparison or a logical expression, because the relational and logical operator mutants of that test cover it.

Structs§

FunctionRef
The function that contains a mutant.
Instrumented
The result of instrument.
Mutant
One mutant.
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§

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.