Documentation
¶
Index ¶
- func MutatorComparison(pkg *types.Package, info *types.Info, node ast.Node) []mutator.Mutation
- func MutatorContextNil(_ *types.Package, info *types.Info, node ast.Node) []mutator.Mutation
- func MutatorErrorGuard(_ *types.Package, info *types.Info, node ast.Node) []mutator.Mutation
- func MutatorLogical(_ *types.Package, _ *types.Info, node ast.Node) []mutator.Mutation
- func MutatorRemoveTerm(pkg *types.Package, info *types.Info, node ast.Node) []mutator.Mutation
- func MutatorStringLiteral(_ *types.Package, _ *types.Info, node ast.Node) []mutator.Mutation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MutatorComparison ¶
MutatorComparison implements a mutator to change comparisons.
func MutatorContextNil ¶ added in v2.6.1
MutatorContextNil replaces context.Context arguments at call sites with nil. Mirrors ooze's context-cancellation operator.
func MutatorErrorGuard ¶ added in v2.6.1
MutatorErrorGuard replaces error-check conditions in if-statements:
if err != nil → if false if err == nil → if true
Inspired by gomu's error-handling mutations.
func MutatorLogical ¶
MutatorLogical swaps && and || operators.
func MutatorRemoveTerm ¶
MutatorRemoveTerm implements a mutator to remove expression terms.
func MutatorStringLiteral ¶ added in v2.6.7
MutatorStringLiteral zeros non-empty string literals in equality and inequality comparisons (== and !=). This tests whether the exact string value matters — e.g. if err.Error() == "not found" where "" would pass when no error occurs but fail when the specific message is expected.
Scoped to comparisons only to avoid high-noise mutations in log messages, metric names, and other strings whose values are not asserted by tests.
Types ¶
This section is empty.