testutil

package
v0.0.0-...-7cb6218 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

package testutil provides test helper functions

Index

Constants

This section is empty.

Variables

View Source
var FailedTopLevelCheckOpts []cmp.Option = []cmp.Option{
	cmpopts.EquateEmpty(),
	cmpopts.SortSlices(lessTopLevelCheck),
}
View Source
var PkgResultsOpts []cmp.Option = []cmp.Option{
	cmpopts.EquateEmpty(),
	cmpopts.SortSlices(func(package1, package2 *types.PkgResult) bool {
		return package1.Package.SpdxID < package2.Package.SpdxID
	}),
	cmpopts.SortSlices(func(error1, error2 *types.NonConformantField) bool {

		return error1.Error.ErrorMsg < error2.Error.ErrorMsg
	}),
	cmpopts.SortSlices(func(s1, s2 string) bool { return s1 < s2 }),
}

Functions

This section is empty.

Types

type BadReader

type BadReader struct{}

func (BadReader) Read

func (BadReader) Read(p []byte) (int, error)

type FailedTopLevelCheck

type FailedTopLevelCheck struct {
	Name  string
	Specs []string
}

FailedTopLevelCheck represents a check that has failed.

This is toplevel version of types.Output.PkgResults. Ideally, the package-level and top-level versions of a list of failed checks are made consistent - either in types.Output or not. This struct and associated function are the first step towards that.

func ExtractFailedTopLevelChecks

func ExtractFailedTopLevelChecks(
	topLevelChecks []*types.TopLevelCheckResult,
) []FailedTopLevelCheck

ExtractFailedTopLevelChecks returns the failed checks in the input.

Jump to

Keyboard shortcuts

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