conditional

package
v2.7.6 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MutatorBoolLiteral added in v2.6.7

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

MutatorBoolLiteral swaps true↔false in assignment right-hand sides and function call arguments. It tests whether the hardcoded boolean value matters — e.g. a config flag defaulting to true that no test ever flips.

Return statements are intentionally excluded: statement/return already handles bool return values by zeroing them. If-conditions are excluded because conditional/not covers that case more precisely.

func MutatorConditionalNegated

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

MutatorConditionalNegated implements a mutator to improved comparison changes.

func MutatorConditionalNot added in v2.6.7

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

MutatorConditionalNot removes the logical-NOT operator from a negated boolean expression: !x becomes x. This tests whether the negation is actually required — a test that only exercises one branch will miss this mutation.

Works on if/for conditions and the operands of && / || expressions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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