assert

package
v0.0.0-...-e9f0680 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorTypeNotEqual    = errors.New("type inconsistency")
	ErrorMapKeyInvalided = errors.New("key is invalid")
	ErrorUnKnownType     = errors.New("unknown type comparison")
	ErrorLengthNotEqual  = errors.New("data length is inconsistent")
)

Functions

func IsRegExpPattern

func IsRegExpPattern(pattern interface{}) bool

func Match

func Match(pattern string, matchValue interface{}) error

func So

func So(log logger.Logger, assertType string, actual interface{}, expected interface{}) error

So Verify that the input value is consistent with the expected value

Types

type Assert

type Assert struct {
	// contains filtered or unexported fields
}

func NewAssert

func NewAssert(log logger.Logger, assertType string, actual interface{}, expected interface{}) *Assert

type AssertError

type AssertError struct {
	Type      string
	Err       error
	FieldName string
	Actual    interface{}
	Expected  interface{}
}

cases assert error types

func NewAssertError

func NewAssertError(assertType string, err error, actual interface{}, expected interface{}, fieldName string) *AssertError

func (*AssertError) Error

func (e *AssertError) Error() string

Jump to

Keyboard shortcuts

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