testcase

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSample       = errors.New("sample")
	CompareErrorsIs = goCmp.Comparer(func(e1, e2 error) bool {
		if e1 == nil || e2 == nil {
			return e1 == nil && e2 == nil
		} else {

			return errors.Is(e1, e2) || errors.Is(e2, e1)
		}
	})
	CompareErrorsAs = goCmp.Comparer(func(i, j error) bool {
		e2Any := any(j)
		return errors.As(i, &e2Any)
	})
	CompareReflectStructField = goCmp.Comparer(func(i, j reflect.StructField) bool {
		return i.Name == j.Name && i.PkgPath == j.PkgPath
	})
	CompareReflectValue = goCmp.Comparer(func(i, j reflect.Value) bool {
		return i.Interface() == j.Interface()
	})
)

Functions

This section is empty.

Types

type Map

type Map[K comparable, V any] struct {
	Seq      func() iter.Seq2[K, V]
	Seqs     []func() iter.Seq2[K, V]
	Expected map[K]V
	BreakAt  int
	CmpOpt   []goCmp.Option
	Stateful bool
}

func (Map[K, V]) Test

func (tc Map[K, V]) Test(t *testing.T, cb ...func())

type One

type One[V any] struct {
	Seq      func() iter.Seq[V]
	Seqs     []func() iter.Seq[V]
	Expected []V
	BreakAt  int
	CmpOpt   []goCmp.Option
	Stateful bool
}

func (One[V]) Test

func (tc One[V]) Test(t *testing.T, cb ...func(length, count int))

type Two

type Two[K, V any] struct {
	Seq      func() iter.Seq2[K, V]
	Seqs     []func() iter.Seq2[K, V]
	Expected []hiter.KeyValue[K, V]
	BreakAt  int
	CmpOpt   []goCmp.Option
	Stateful bool
}

func (Two[K, V]) Test

func (tc Two[K, V]) Test(t *testing.T, cb ...func(length, count int))

Jump to

Keyboard shortcuts

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