testing

package
v0.0.0-...-cd4ae88 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MIT Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsJSON

func AsJSON(v any) ([]byte, error)

func Expect

func Expect[A any](t testing.TB, actual A, matchers ...Matcher[A])

func MatchSnapshot

func MatchSnapshot(name string, options ...snapshot.Option) internal.Matcher[*snapshot.Snapshot]

func MustAsJSON

func MustAsJSON(v any) []byte

func NewCompareMatcher

func NewCompareMatcher[A any, E any](name string, match func(a A, e E) bool) func(e E) Matcher[A]

func NewSnapshot

func NewSnapshot() *snapshot.Snapshot

func ProjectRoot

func ProjectRoot() string

Types

type ExpectedFormatter

type ExpectedFormatter = internal.ExpectedFormatter

type Matcher

type Matcher[A any] = internal.Matcher[A]

func Be

func Be[T any](e T) Matcher[T]

func BeEmpty

func BeEmpty[T any]() Matcher[T]

func BeFalse

func BeFalse() Matcher[bool]

func BeNil

func BeNil[T any]() Matcher[T]

func BeTrue

func BeTrue() Matcher[bool]

func Equal

func Equal[T any](e T) Matcher[T]

func HaveCap

func HaveCap[T any](c int) Matcher[T]

func HaveLen

func HaveLen[T any](c int) Matcher[T]

func NewMatcher

func NewMatcher[A any](name string, match func(a A) bool) Matcher[A]

func Not

func Not[A any](matcher Matcher[A]) Matcher[A]

func NotBe

func NotBe[T any](e T) Matcher[T]

func NotBeEmpty

func NotBeEmpty[T any]() Matcher[T]

func NotBeNil

func NotBeNil[T any]() Matcher[T]

func NotEqual

func NotEqual[T any](e T) Matcher[T]

func NotHaveCap

func NotHaveCap[T any](c int) Matcher[T]

func NotHaveLen

func NotHaveLen[T any](c int) Matcher[T]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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