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§
- Function
Ref - The function that contains a mutant.
- Instrumented
- The result of
instrument. - Mutant
- One mutant.
- Mutant
Change - The edit of a mutant without project text.
- Mutant
Id - The stable identity of a mutant: 16 lowercase hex digits.
- Mutation
Options - Options for
instrument. - Script
Block - One script block of a component file.
- Splice
Map - Maps instrumented byte offsets back to original byte offsets.
- Splice
Segment - One copied run of original text in the instrumented output.
Enums§
- Mutation
Error - An error from
instrument. - Operator
- One mutation operator.
- Script
Role - The role of a script block in a component file.
- Source
Kind - 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.defaultnames a default export. A class or an object literal that holds the function is not a function to call, so it givesNone. - instrument
- Finds the mutants in
sourceand returns the instrumented text. - instrument_
blocks - Finds the mutants in the script blocks of a component file and returns the instrumented file.