coverage

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package coverage is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(profileName string) (Coverage, bool)
	Set(profileName string, coverage Coverage)
}

type Calculator

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

func NewCalculator

func NewCalculator(filesRegistry FilesRegistry) *Calculator

func (*Calculator) CoverageByDirectory

func (c *Calculator) CoverageByDirectory(dir tree.Directory) Coverage

func (*Calculator) CoverageByProfile

func (c *Calculator) CoverageByProfile(profile *cover.Profile) Coverage

type Coverage

type Coverage struct {
	// Coverage summary by statements.
	Statements CoverageItem

	// Coverage summary by lines.
	Lines CoverageItem

	// Coverage summary by functions.
	Functions CoverageItem

	// Coverage total summary
	TotalPercent float64
}

type CoverageItem

type CoverageItem struct {
	Total   int
	Covered int
	Percent float64
}

func NewCoverageItem

func NewCoverageItem(total, covered int) CoverageItem

type FilesRegistry

type FilesRegistry interface {
	GetFile(fileName string) (*files.File, bool)
}

type MockCache

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

MockCache is a mock of Cache interface.

func NewMockCache

func NewMockCache(ctrl *gomock.Controller) *MockCache

NewMockCache creates a new mock instance.

func (*MockCache) EXPECT

func (m *MockCache) EXPECT() *MockCacheMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCache) Get

func (m *MockCache) Get(profileName string) (Coverage, bool)

Get mocks base method.

func (*MockCache) Set

func (m *MockCache) Set(profileName string, coverage Coverage)

Set mocks base method.

type MockCacheMockRecorder

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

MockCacheMockRecorder is the mock recorder for MockCache.

func (*MockCacheMockRecorder) Get

func (mr *MockCacheMockRecorder) Get(profileName any) *gomock.Call

Get indicates an expected call of Get.

func (*MockCacheMockRecorder) Set

func (mr *MockCacheMockRecorder) Set(profileName, coverage any) *gomock.Call

Set indicates an expected call of Set.

type MockFilesRegistry

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

MockFilesRegistry is a mock of FilesRegistry interface.

func NewMockFilesRegistry

func NewMockFilesRegistry(ctrl *gomock.Controller) *MockFilesRegistry

NewMockFilesRegistry creates a new mock instance.

func (*MockFilesRegistry) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockFilesRegistry) GetFile

func (m *MockFilesRegistry) GetFile(fileName string) (*files.File, bool)

GetFile mocks base method.

type MockFilesRegistryMockRecorder

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

MockFilesRegistryMockRecorder is the mock recorder for MockFilesRegistry.

func (*MockFilesRegistryMockRecorder) GetFile

func (mr *MockFilesRegistryMockRecorder) GetFile(fileName any) *gomock.Call

GetFile indicates an expected call of GetFile.

Jump to

Keyboard shortcuts

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