check

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal[Type any](t common.T, want Type, got Type, opts ...cmp.Option) bool

Equal returns true if want == got, otherwise marks the test as failed and returns false.

This is a typesafe check for inequality using go-cmp, allowing arguments only of the same type to be compared. Most of the time, this is the equality-checking method that you want.

You can change the behavior of the equality checking using the go-cmp/cmp Options system. For more information, see [the go-cmp documentation](https://pkg.go.dev/github.com/google/go-cmp/cmp#Equal).

func Error

func Error(t common.T, err error) bool

Error returns true if err != nil, otherwise marks the test as failed and returns false.

func False

func False(t common.T, x bool) bool

False returns true if x == false, otherwise marks the test as failed and returns false.

func GreaterThan

func GreaterThan[Type constraints.Ordered](t common.T, big Type, small Type) bool

GreaterThan returns true if big > small, otherwise marks the test as failed and returns false.

func GreaterThanOrEqual

func GreaterThanOrEqual[Type constraints.Ordered](t common.T, big Type, small Type) bool

GreaterThanOrEqual returns true if big >= small, otherwise marks the test as failed and returns false.

func In

func In[Type any](t common.T, element Type, slice []Type, opts ...cmp.Option) bool

In returns true if element is in slice, otherwise marks the test as failed and returns false.

func LessThan

func LessThan[Type constraints.Ordered](t common.T, small Type, big Type) bool

LessThan returns true if small < big, otherwise marks the test as failed and returns false.

func LessThanOrEqual

func LessThanOrEqual[Type constraints.Ordered](t common.T, small Type, big Type) bool

LessThanOrEqual returns true if small <= big, otherwise marks the test as failed and returns false.

func Nil

func Nil(t common.T, err error) bool

Nil returns true if err == nil, otherwise marks the test as failed and returns false.

func NotEqual

func NotEqual[Type any](t common.T, want Type, got Type, opts ...cmp.Option) bool

NotEqual returns true if want != got, otherwise marks the test as failed and returns false.

This is a typesafe check for inequality using go-cmp, allowing arguments only of the same type to be compared. Most of the time, this is the inequality-checking method that you want.

You can change the behavior of the equality checking using the go-cmp/cmp Options system. For more information, see [the go-cmp documentation](https://pkg.go.dev/github.com/google/go-cmp/cmp#Equal).

func NotIn

func NotIn[Type any](t common.T, element Type, slice []Type, opts ...cmp.Option) bool

NotIn returns true if element is not in slice, otherwise marks the test as failed and returns false.

func True

func True(t common.T, x bool) bool

True returns true if x == true, otherwise marks the test as failed and returns false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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