Documentation ¶
Index ¶
- func Expect[A any](t testing.TB, actual A, matchers ...Matcher[A])
- func NewCompareMatcher[A any, E any](name string, match func(a A, e E) bool) func(e E) Matcher[A]
- func ProjectRoot() string
- func WithSnapshotUpdate() func(m *snapshotMatcher)
- func WithWorkDir(wd string) func(m *snapshotMatcher)
- type ExpectedFormatter
- type Matcher
- func Be[T any](e T) Matcher[T]
- func BeEmpty[T any]() Matcher[T]
- func BeFalse() Matcher[bool]
- func BeNil[T any]() Matcher[T]
- func BeTrue() Matcher[bool]
- func Equal[T any](e T) Matcher[T]
- func HaveCap[T any](c int) Matcher[T]
- func HaveLen[T any](c int) Matcher[T]
- func MatchSnapshot(name string, optionFuncs ...func(m *snapshotMatcher)) Matcher[*txtar.Archive]
- func NewMatcher[A any](name string, match func(a A) bool) Matcher[A]
- func Not[A any](matcher Matcher[A]) Matcher[A]
- func NotBe[T any](e T) Matcher[T]
- func NotBeEmpty[T any]() Matcher[T]
- func NotBeNil[T any]() Matcher[T]
- func NotEqual[T any](e T) Matcher[T]
- func NotHaveCap[T any](c int) Matcher[T]
- func NotHaveLen[T any](c int) Matcher[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCompareMatcher ¶
func ProjectRoot ¶
func ProjectRoot() string
func WithSnapshotUpdate ¶
func WithSnapshotUpdate() func(m *snapshotMatcher)
func WithWorkDir ¶
func WithWorkDir(wd string) func(m *snapshotMatcher)
Types ¶
type ExpectedFormatter ¶
type ExpectedFormatter interface {
FormatExpected() string
}
type Matcher ¶
type Matcher[A any] interface { Name() string Negative() bool Match(actual A) bool FormatActual(actual A) string }
func MatchSnapshot ¶
func NotBeEmpty ¶
func NotHaveCap ¶
func NotHaveLen ¶
Click to show internal directories.
Click to hide internal directories.