utests

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateLogMessage

func ValidateLogMessage(isExpectedMessage func(checker.LogMessage, checker.DetailType) bool,
	dl *TestDetailLogger,
) bool

ValidateLogMessage tests that at least one log message returns true for isExpectedMessage.

func ValidateLogMessageOffsets

func ValidateLogMessageOffsets(dl *TestDetailLogger, offsets []uint) bool

ValidateLogMessageOffsets tests that the log message offsets match those in the passed in slice.

func ValidatePinningDependencies

func ValidatePinningDependencies(isExpectedDependency func(checker.Dependency) bool,
	r *checker.PinningDependenciesData,
) bool

ValidatePinningDependencies tests that at least one entry returns true for isExpectedMessage.

func ValidateTestReturn

func ValidateTestReturn(
	t *testing.T,
	name string,
	expected *TestReturn,
	actual *checker.CheckResult,
	logger *TestDetailLogger,
) bool

ValidateTestReturn validates expected TestReturn with actual checker.CheckResult values. nolint: thelper

Types

type TestDetailLogger

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

TestDetailLogger implements `checker.DetailLogger`.

func (*TestDetailLogger) Debug

func (l *TestDetailLogger) Debug(msg *checker.LogMessage)

Debug implements DetailLogger.Debug.

func (*TestDetailLogger) Flush

func (l *TestDetailLogger) Flush() []checker.CheckDetail

Flush implements DetailLogger.Flush.

func (*TestDetailLogger) Info

func (l *TestDetailLogger) Info(msg *checker.LogMessage)

Info implements DetailLogger.Info.

func (*TestDetailLogger) Warn

func (l *TestDetailLogger) Warn(msg *checker.LogMessage)

Warn implements DetailLogger.Warn.

type TestReturn

type TestReturn struct {
	Error         error
	Score         int
	NumberOfWarn  int
	NumberOfInfo  int
	NumberOfDebug int
}

TestReturn encapsulates expected CheckResult return values.

Jump to

Keyboard shortcuts

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