utests

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package utests defines util fns for Scorecard unit testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateTestReturn

func ValidateTestReturn(t *testing.T, name string, te *TestReturn,
	tr *checker.CheckResult, dl *TestDetailLogger) bool

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

func ValidateTestValues added in v2.1.3

func ValidateTestValues(t *testing.T, name string, te *TestReturn,
	score int, err error, dl *TestDetailLogger) bool

ValidateTestValues validates returned score and log 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) Info

func (l *TestDetailLogger) Info(desc string, args ...interface{})

Info implements DetailLogger.Info.

func (*TestDetailLogger) Warn

func (l *TestDetailLogger) Warn(desc string, args ...interface{})

Warn implements DetailLogger.Warn.

type TestReturn

type TestReturn struct {
	Errors        []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