match

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matcher

type Matcher interface {
	Matches(actual any) (ok bool, desc string)
	String() string
}

func All

func All(expected ...any) Matcher

func Any

func Any() Matcher

func Between

func Between(min, max any) Matcher

func BetweenStrict

func BetweenStrict(min, max any) Matcher

func Contains

func Contains(value any) Matcher

func ContainsKey

func ContainsKey(key any) Matcher

func ContainsKeyValue

func ContainsKeyValue(key, value any) Matcher

func Equal

func Equal(expected any, options ...cmp.Option) Matcher

func Fn

func Fn(fn any) Matcher

func If

func If(condition Matcher, branches ...any) Matcher

func Len

func Len(len any) Matcher

func Map

func Map(keyAndValues ...any) Matcher

func MapExact

func MapExact(keyAndValues ...any) Matcher

func Method

func Method(method string, actual ...any) Matcher

func None

func None() Matcher

func Not

func Not(expected any) Matcher

func Prefix

func Prefix(prefix any) Matcher

func Regexp

func Regexp(expected any) Matcher

func Same

func Same(expected any) Matcher

func SamePointer

func SamePointer(expected any) Matcher

func Suffix

func Suffix(suffix any) Matcher

func ToMatcher

func ToMatcher(expected any) Matcher

func ToMatchers

func ToMatchers(expected []any) []Matcher

type SimpleMatcher

type SimpleMatcher interface {
	Matches(actual any) bool
}

type StatefulMatcher

type StatefulMatcher interface {
	Matcher
	Stateful() Matcher
}

func AnyOf

func AnyOf(expected ...any) StatefulMatcher

func AtLeastOf

func AtLeastOf(n int, expected ...any) StatefulMatcher

func AtMostOf

func AtMostOf(n int, expected ...any) StatefulMatcher

func BetweenOf

func BetweenOf(min int, max int, expected ...any) StatefulMatcher

func OneOf

func OneOf(expected ...any) StatefulMatcher

Jump to

Keyboard shortcuts

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