mutations

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Conflict

type Conflict struct {
	ID        uuid.UUID
	StartLine int
	EndLine   int
	Mutations []*Mutation
}

Conflict represents all mutations that would conflict with each other if they were displayed simultaneously.

func NewConflict

func NewConflict(m *Mutation) *Conflict

func (*Conflict) Append

func (c *Conflict) Append(m *Mutation)

func (*Conflict) ConflictsWithConflict added in v1.2.0

func (c *Conflict) ConflictsWithConflict(cb *Conflict) bool

func (*Conflict) ConflictsWithMutation added in v1.2.0

func (c *Conflict) ConflictsWithMutation(m *Mutation) bool

func (*Conflict) Merge added in v1.2.0

func (c *Conflict) Merge(cb *Conflict)

func (*Conflict) ResizeToInclude added in v1.2.0

func (c *Conflict) ResizeToInclude(m *Mutation)

type Conflicts

type Conflicts []*Conflict

Conflicts is a slice of Conflict instances.

func (Conflicts) GetMutant

func (c Conflicts) GetMutant(ID uuid.UUID) (*Conflict, *Mutation)

func (Conflicts) Sort

func (c Conflicts) Sort()

type Mutation

type Mutation struct {
	ID                uuid.UUID
	FrameworkMutantID string // FrameworkMutantID is an optional identifier provided by a framework.
	Description       string // Description functions as the mutations title, it is displayed to the user when they preview the mutation.
	Operation         string // Operation is an optional (short) description of the operation.
	Start             *Range
	End               *Range
	Status            Status
	Replacement       string
}

Mutation represents a single mutation.

func (Mutation) GetDescription added in v1.2.0

func (m Mutation) GetDescription() string

func (Mutation) IsBroken added in v1.2.0

func (m Mutation) IsBroken() bool

IsBroken returns whether a mutation is broken or not. Marv treats any mutation where the End Range is lower than the Start Range.

type Mutations

type Mutations map[string]Conflicts

Mutations is a map of file names to groups of conflicting mutations.

func (Mutations) Append

func (m Mutations) Append(file string, mutation *Mutation)

func (Mutations) ExtractBrokenMutations added in v1.2.0

func (m Mutations) ExtractBrokenMutations() []*Mutation

func (Mutations) GenerateIDs

func (m Mutations) GenerateIDs()

GenerateIDs generates UUIDs for all conflicts and mutations

func (Mutations) Merge

func (m Mutations) Merge(b Mutations)

func (Mutations) MergeConflicting added in v1.2.0

func (m Mutations) MergeConflicting()

func (Mutations) StatisticsFrom

func (m Mutations) StatisticsFrom(prefix string) Statistics

type Range

type Range struct {
	Line int
	Char int
}

Range holds a line and char index.

func (Range) LessThan added in v1.2.0

func (r Range) LessThan(rge *Range) bool

func (Range) String added in v1.2.0

func (r Range) String() string

type Statistics

type Statistics struct {
	Count        float64
	StatusCounts map[Status]float64
}

func (Statistics) Coverage

func (s Statistics) Coverage() float64

func (Statistics) Covered added in v1.2.0

func (s Statistics) Covered() float64

func (Statistics) Detected added in v1.2.0

func (s Statistics) Detected() float64

func (Statistics) Invalid added in v1.2.0

func (s Statistics) Invalid() float64

func (Statistics) Score

func (s Statistics) Score() float64

func (Statistics) ScoreOfCovered

func (s Statistics) ScoreOfCovered() float64

func (Statistics) Undetected added in v1.2.0

func (s Statistics) Undetected() float64

func (Statistics) Valid added in v1.2.0

func (s Statistics) Valid() float64

type Status

type Status string

Status represents the outcome of a mutation.

const (
	Killed     Status = "KILLED"
	Survived   Status = "SURVIVED"
	Crashed    Status = "CRASHED"
	Timeout    Status = "TIMEOUT"
	NoCoverage Status = "NO_COVERAGE"
	Pending    Status = "PENDING"
	Ignored    Status = "IGNORED"
)

func (Status) Icon

func (s Status) Icon() string

Icon returns the icon belonging to the respective Status.

func (Status) IconWithText

func (s Status) IconWithText() string

func (Status) Text

func (s Status) Text() string

Jump to

Keyboard shortcuts

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