expression

package
v2.6.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MutatorComparison

func MutatorComparison(pkg *types.Package, info *types.Info, node ast.Node) []mutator.Mutation

MutatorComparison implements a mutator to change comparisons.

func MutatorContextNil added in v2.6.1

func MutatorContextNil(_ *types.Package, info *types.Info, node ast.Node) []mutator.Mutation

MutatorContextNil replaces context.Context arguments at call sites with nil. Mirrors ooze's context-cancellation operator.

func MutatorErrorGuard added in v2.6.1

func MutatorErrorGuard(_ *types.Package, info *types.Info, node ast.Node) []mutator.Mutation

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

func MutatorLogical(_ *types.Package, _ *types.Info, node ast.Node) []mutator.Mutation

MutatorLogical swaps && and || operators.

func MutatorRemoveTerm

func MutatorRemoveTerm(pkg *types.Package, info *types.Info, node ast.Node) []mutator.Mutation

MutatorRemoveTerm implements a mutator to remove expression terms.

func MutatorStringLiteral added in v2.6.7

func MutatorStringLiteral(_ *types.Package, _ *types.Info, node ast.Node) []mutator.Mutation

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL