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 []int) bool
- func ValidateTestReturn(t *testing.T, name string, expected *TestReturn, actual *checker.CheckResult, ...) bool
- type TestDetailLogger
- func (l *TestDetailLogger) Debug(desc string, args ...interface{})
- func (l *TestDetailLogger) Debug3(msg *checker.LogMessage)
- func (l *TestDetailLogger) Info(desc string, args ...interface{})
- func (l *TestDetailLogger) Info3(msg *checker.LogMessage)
- func (l *TestDetailLogger) Warn(desc string, args ...interface{})
- func (l *TestDetailLogger) Warn3(msg *checker.LogMessage)
- 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 []int) 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(desc string, args ...interface{})
Debug implements DetailLogger.Debug.
func (*TestDetailLogger) Debug3 ¶
func (l *TestDetailLogger) Debug3(msg *checker.LogMessage)
Debug3 implements DetailLogger.Debug3.
func (*TestDetailLogger) Info ¶
func (l *TestDetailLogger) Info(desc string, args ...interface{})
Info implements DetailLogger.Info.
func (*TestDetailLogger) Info3 ¶
func (l *TestDetailLogger) Info3(msg *checker.LogMessage)
Info3 implements DetailLogger.Info3.
func (*TestDetailLogger) Warn ¶
func (l *TestDetailLogger) Warn(desc string, args ...interface{})
Warn implements DetailLogger.Warn.
func (*TestDetailLogger) Warn3 ¶
func (l *TestDetailLogger) Warn3(msg *checker.LogMessage)
Warn3 implements DetailLogger.Warn3.
Click to show internal directories.
Click to hide internal directories.