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