ditto

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchLaboratory added in v0.3.0

type BatchLaboratory interface {
	TestAll(repository Repository, files []*gomutatedfile.GoMutatedFile) []future.Future[result.Result[string]]
}

BatchLaboratory is handed every mutant of one file together.

One compilation can only serve several mutants if the compiler is given all of them at once, and the gated path needs exactly that. It is a separate interface rather than a change to Laboratory so that every laboratory that exists today goes on being asked one mutant at a time, unchanged.

The batch cannot be assembled lower down. Test returns a future, and a laboratory could in principle buffer and resolve later — but testingtlaboratory awaits inside each subtest, immediately, so a laboratory waiting for mutants that have not been submitted yet would wait forever.

type Diagnostic

type Diagnostic struct {
	// contains filtered or unexported fields
}

func (*Diagnostic) Address added in v0.3.0

func (d *Diagnostic) Address() string

Address and Change are what a survivor is reported as before any diff is rendered: where it is, and what it wrote there.

func (*Diagnostic) Change added in v0.3.0

func (d *Diagnostic) Change() string

func (*Diagnostic) Diff

func (d *Diagnostic) Diff(differ gomutatedfile.Differ) string

func (*Diagnostic) IsOk

func (d *Diagnostic) IsOk() bool

func (*Diagnostic) Label

func (d *Diagnostic) Label() string

type Ditto

type Ditto struct {
	// contains filtered or unexported fields
}

func New

func New(repository Repository, laboratory Laboratory, reporter Reporter) *Ditto

func (*Ditto) Release

func (o *Ditto) Release(viri ...viruses.Virus)

Release mutates every source file and reports what each mutant did.

Mutants are kept together by the file they came from, because a laboratory that compiles once for a whole file has to receive the file's mutants at once. The order they are reported in is unchanged: sources are walked in order, and each file's mutants in the order its viruses produced them.

type Laboratory

type Laboratory interface {
	Test(repository Repository, file *gomutatedfile.GoMutatedFile) future.Future[result.Result[string]]
}

type Logger

type Logger interface {
	Logf(message string, args ...any)
}

type Reporter

type Reporter interface {
	AddDiagnostic(diagnostic *Diagnostic)
	Summarize() result.Result[any]
}

type Repository

type Repository interface {
	ListGoSourceFiles() []*gosourcefile.GoSourceFile
	LinkAllToTemporaryRepository(temporaryPath string) TemporaryRepository
}

type ScoreCalculator

type ScoreCalculator func(total, killed int) float32

type TemporaryRepository

type TemporaryRepository interface {
	Root() string
	Overwrite(filePath string, data []byte)
	Remove()
}

Jump to

Keyboard shortcuts

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