test

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIsErr

func CheckIsErr(t testing.TB, err error, msg string)

CheckIsErr fails if err ==nil. Print msg as an error message.

func CheckMarshal added in v1.6.2

func CheckMarshal(
	t *testing.T,
	x, y interface {
		encoding.BinaryMarshaler
		encoding.BinaryUnmarshaler
	},
)

func CheckNoErr

func CheckNoErr(t testing.TB, err error, msg string)

CheckNoErr fails if err !=nil. Print msg as an error message.

func CheckOk added in v1.1.0

func CheckOk(result bool, msg string, t testing.TB)

CheckOk fails the test if result == false.

func CheckPanic

func CheckPanic(f func()) error

CheckPanic returns true if call to function 'f' caused panic.

func ReadGzip added in v1.6.2

func ReadGzip(path string) ([]byte, error)

Like os.ReadFile, but gunzip first.

func ReportError

func ReportError(t testing.TB, got, want interface{}, inputs ...interface{})

ReportError reports an error if got is different from want.

Types

type ACVP added in v1.6.5

type ACVP struct {
	// Groups are the raw test groups of the prompt file. Unmarshal each one
	// into whatever shape the algorithm under test expects.
	Groups []json.RawMessage
	// contains filtered or unexported fields
}

ACVP is a decoded pair of ACVP test vector files: the prompt file, holding the test groups, and the expectedResults file, holding the results indexed by test case id.

Vectors come from https://github.com/usnistgov/ACVP-Server, where every algorithm directory pairs a prompt.json with an expectedResults.json.

func ReadACVP added in v1.6.5

func ReadACVP(t testing.TB, dir string) *ACVP

ReadACVP reads the gzipped prompt and expectedResults files of the ACVP test vector directory dir.

func (*ACVP) Result added in v1.6.5

func (a *ACVP) Result(t testing.TB, tcID int, result interface{})

Result unmarshals the expected result of test case tcID into result.

type HexBytes added in v1.6.2

type HexBytes []byte

[]byte but is encoded in hex for JSON

func (HexBytes) MarshalJSON added in v1.6.2

func (b HexBytes) MarshalJSON() ([]byte, error)

func (*HexBytes) UnmarshalJSON added in v1.6.2

func (b *HexBytes) UnmarshalJSON(data []byte) (err error)

Jump to

Keyboard shortcuts

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