Documentation ¶
Index ¶
- func Join[T any](a []T, sep string) string
- type AssertionMessage
- func Assert(isSuccessful bool, str string, args ...any) AssertionMessage
- func Error(err error) AssertionMessage
- func False(actual bool) AssertionMessage
- func Nil[T any](actual *T) AssertionMessage
- func NilError(err error) AssertionMessage
- func NotNil[T any](actual *T) AssertionMessage
- func True(actual bool) AssertionMessage
- type Hammy
- type Mappy
- func (m Mappy[K, V]) EqualTo(expected map[K]V) AssertionMessage
- func (m Mappy[K, V]) IsEmpty() AssertionMessage
- func (m Mappy[K, V]) Len(expected int) AssertionMessage
- func (m Mappy[K, V]) WithItem(k K, expected V) AssertionMessage
- func (m Mappy[K, V]) WithKeys(expected ...K) AssertionMessage
- func (m Mappy[K, V]) WithValues(values ...V) AssertionMessage
- func (m Mappy[K, V]) WithoutKeys(keys ...K) AssertionMessage
- type Num
- func (n *Num[N]) EqualTo(expected N) AssertionMessage
- func (n *Num[N]) GreaterOrEqual(expected N) AssertionMessage
- func (n *Num[N]) GreaterThan(expected N) AssertionMessage
- func (n *Num[N]) IsZero() AssertionMessage
- func (n *Num[N]) LessOrEqual(expected N) AssertionMessage
- func (n *Num[N]) LessThan(expected N) AssertionMessage
- func (n *Num[N]) NotEqual(expected N) AssertionMessage
- func (n *Num[N]) Within(expected N, error float64) AssertionMessage
- type Numeric
- type Slc
- type St
- type Str
- func (s *Str[S]) Contains(expected string) AssertionMessage
- func (s *Str[S]) EqualTo(expected S) AssertionMessage
- func (s *Str[S]) HasPrefix(expected string) AssertionMessage
- func (s *Str[S]) HasSuffix(expected string) AssertionMessage
- func (s *Str[S]) IsEmpty() AssertionMessage
- func (s *Str[S]) ToLowerEqualTo(expected string) AssertionMessage
- type Stringy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssertionMessage ¶
func Error ¶
func Error(err error) AssertionMessage
func False ¶
func False(actual bool) AssertionMessage
func Nil ¶
func Nil[T any](actual *T) AssertionMessage
func NilError ¶
func NilError(err error) AssertionMessage
func NotNil ¶
func NotNil[T any](actual *T) AssertionMessage
func True ¶
func True(actual bool) AssertionMessage
type Hammy ¶
func (*Hammy) Is ¶
func (h *Hammy) Is(a AssertionMessage)
func (*Hammy) That ¶
func (h *Hammy) That(msg string, a AssertionMessage)
type Mappy ¶
type Mappy[K comparable, V any] struct { // contains filtered or unexported fields }
func Map ¶
func Map[K comparable, V any](actual map[K]V) *Mappy[K, V]
func (Mappy[K, V]) EqualTo ¶
func (m Mappy[K, V]) EqualTo(expected map[K]V) AssertionMessage
func (Mappy[K, V]) IsEmpty ¶
func (m Mappy[K, V]) IsEmpty() AssertionMessage
func (Mappy[K, V]) Len ¶
func (m Mappy[K, V]) Len(expected int) AssertionMessage
func (Mappy[K, V]) WithItem ¶
func (m Mappy[K, V]) WithItem(k K, expected V) AssertionMessage
func (Mappy[K, V]) WithKeys ¶
func (m Mappy[K, V]) WithKeys(expected ...K) AssertionMessage
func (Mappy[K, V]) WithValues ¶
func (m Mappy[K, V]) WithValues(values ...V) AssertionMessage
func (Mappy[K, V]) WithoutKeys ¶
func (m Mappy[K, V]) WithoutKeys(keys ...K) AssertionMessage
type Num ¶
type Num[N Numeric] struct { // contains filtered or unexported fields }
func (*Num[N]) EqualTo ¶
func (n *Num[N]) EqualTo(expected N) AssertionMessage
func (*Num[N]) GreaterOrEqual ¶
func (n *Num[N]) GreaterOrEqual(expected N) AssertionMessage
func (*Num[N]) GreaterThan ¶
func (n *Num[N]) GreaterThan(expected N) AssertionMessage
func (*Num[N]) IsZero ¶
func (n *Num[N]) IsZero() AssertionMessage
func (*Num[N]) LessOrEqual ¶
func (n *Num[N]) LessOrEqual(expected N) AssertionMessage
func (*Num[N]) LessThan ¶
func (n *Num[N]) LessThan(expected N) AssertionMessage
func (*Num[N]) NotEqual ¶
func (n *Num[N]) NotEqual(expected N) AssertionMessage
func (*Num[N]) Within ¶
func (n *Num[N]) Within(expected N, error float64) AssertionMessage
type Slc ¶
type Slc[I comparable] struct { // contains filtered or unexported fields }
func Slice ¶
func Slice[I comparable](actual []I) *Slc[I]
func (*Slc[I]) Contains ¶
func (a *Slc[I]) Contains(expected ...I) AssertionMessage
Contains asserts whether the slice contains the expected elements in any order.
func (*Slc[I]) ContainsExactly ¶
func (a *Slc[I]) ContainsExactly(expected ...I) AssertionMessage
ContainsExactly asserts that the slice contains the exact number of elements in any order.
func (*Slc[I]) EqualTo ¶
func (a *Slc[I]) EqualTo(expected ...I) AssertionMessage
EqualTo asserts whether the slice is equal to the expected items in both order and values.
func (*Slc[I]) IsEmpty ¶
func (a *Slc[I]) IsEmpty() AssertionMessage
IsEmpty asserts that the slice contains no elements.
func (*Slc[I]) Len ¶
func (a *Slc[I]) Len(expected int) AssertionMessage
Len asserts that the slice contains exactly the number of elements specified.
type St ¶
type St[S any] struct { // contains filtered or unexported fields }
func (*St[S]) EqualTo ¶
func (s *St[S]) EqualTo(expected S) AssertionMessage
type Str ¶
type Str[S Stringy] struct { // contains filtered or unexported fields }
func (*Str[S]) Contains ¶
func (s *Str[S]) Contains(expected string) AssertionMessage
func (*Str[S]) EqualTo ¶
func (s *Str[S]) EqualTo(expected S) AssertionMessage
func (*Str[S]) HasPrefix ¶
func (s *Str[S]) HasPrefix(expected string) AssertionMessage
func (*Str[S]) HasSuffix ¶
func (s *Str[S]) HasSuffix(expected string) AssertionMessage
func (*Str[S]) IsEmpty ¶
func (s *Str[S]) IsEmpty() AssertionMessage
func (*Str[S]) ToLowerEqualTo ¶
func (s *Str[S]) ToLowerEqualTo(expected string) AssertionMessage
Click to show internal directories.
Click to hide internal directories.