Documentation ¶
Overview ¶
Package utests defines util fns for Scorecard unit testing.
Index ¶
- func ValidateLogMessage(isExpectedMessage func(checker.LogMessage, checker.DetailType) bool, ...) bool
- func ValidateLogMessageOffsets(dl *TestDetailLogger, offsets []uint) bool
- func ValidateTestReturn(t *testing.T, name string, expected *TestReturn, actual *checker.CheckResult, ...) bool
- type TestDetailLogger
- type TestReturn
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 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 ¶ added in v4.1.0
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.
Click to show internal directories.
Click to hide internal directories.