testutils

package
v0.0.0-...-d2a8444 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert[T any](
	name string,
	a T,
	b T,
	predicate func(T, T) bool,
) error

func AssertEqual

func AssertEqual(
	name string,
	a interface{},
	b interface{},
) error

func AssertNil

func AssertNil[T any](
	name string,
	a *T,
) error

func AssertNotNil

func AssertNotNil[T any](
	name string,
	a *T,
) error

func StringsEqual

func StringsEqual(a string, b string) bool

Types

type Testcase

type Testcase[In any, Out any] struct {
	Name    string
	Input   In
	Output  Out
	Process func(In) Out
	Check   func(In, Out) error
}

func (*Testcase[In, Out]) RunFunc

func (tc *Testcase[In, Out]) RunFunc() func(*testing.T)

Jump to

Keyboard shortcuts

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