mutator

package
v0.0.0-...-fe5c347 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArithmeticMutator

type ArithmeticMutator struct{}

ArithmeticMutator mutates arithmetic operators (+, -, *, /).

func (*ArithmeticMutator) Check

func (m *ArithmeticMutator) Check(n ast.Node) []Mutation

func (*ArithmeticMutator) Name

func (m *ArithmeticMutator) Name() string

type BooleanMutator

type BooleanMutator struct{}

BooleanMutator mutates boolean operators (&&, ||).

func (*BooleanMutator) Check

func (m *BooleanMutator) Check(n ast.Node) []Mutation

func (*BooleanMutator) Name

func (m *BooleanMutator) Name() string

type ComparisonMutator

type ComparisonMutator struct{}

ComparisonMutator mutates comparison operators (==, !=, <, >, <=, >=).

func (*ComparisonMutator) Check

func (m *ComparisonMutator) Check(n ast.Node) []Mutation

func (*ComparisonMutator) Name

func (m *ComparisonMutator) Name() string

type ConditionalsBoundaryMutator

type ConditionalsBoundaryMutator struct{}

ConditionalsBoundaryMutator relaxes or tightens boundary checks (< ↔ <=, > ↔ >=).

func (*ConditionalsBoundaryMutator) Check

func (*ConditionalsBoundaryMutator) Name

type IncrementDecrementMutator

type IncrementDecrementMutator struct{}

IncrementDecrementMutator swaps ++ and --.

func (*IncrementDecrementMutator) Check

func (*IncrementDecrementMutator) Name

type Mutation

type Mutation struct {
	ID     string    // Unique identifier for the mutation
	Pos    token.Pos // Position in the source file
	Apply  func()    // Applies the mutation to the AST
	Revert func()    // Reverts the mutation
}

Mutation represents a single code mutation.

type Mutator

type Mutator interface {
	// Name returns the name of the mutator.
	Name() string
	// Check checks a node for possible mutations and returns them.
	Check(n ast.Node) []Mutation
}

Mutator defines the interface for code mutations.

type ReverseIfCond

type ReverseIfCond struct{}

ReverseIfCond negates the condition of an if statement.

func (*ReverseIfCond) Check

func (m *ReverseIfCond) Check(n ast.Node) []Mutation

func (*ReverseIfCond) Name

func (m *ReverseIfCond) Name() string

Jump to

Keyboard shortcuts

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