coverage

package
v0.0.0-...-00b7fb6 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchSymbolToTest

func MatchSymbolToTest(symbolName, testName string) bool

MatchSymbolToTest returns true if a test name matches a symbol. symbolName can be either "FunctionName" or "ReceiverType.MethodName" Also handles constructor matching: TestVue matches NewVue because NewVue returns Vue

func ParseTestName

func ParseTestName(testName string) []string

ParseTestName extracts the symbol it tests from a test or benchmark function name. Supports patterns like: - TestSymbol / BenchmarkSymbol - TestSymbol_context / BenchmarkSymbol_context - TestReceiver_Method / BenchmarkReceiver_Method - TestReceiver_Method_context / BenchmarkReceiver_Method_context

Types

type Analyzer

type Analyzer struct{}

Analyzer performs symbol-test coverage analysis.

func New

func New() *Analyzer

New creates a new symbol-test coverage analyzer.

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(pkgs []*packages.Package) (*Report, error)

Analyze examines packages and returns symbol-test coverage information.

type Report

type Report struct {
	Symbols         map[string][]string `json:"symbols"`
	Uncovered       []string            `json:"uncovered"`
	StandaloneTests []string            `json:"standalone_tests"`
	CoverageRatio   float64             `json:"coverage_ratio"`
}

Report contains symbol-test coverage analysis results.

Jump to

Keyboard shortcuts

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