assert

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MulanPSL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package assert is for assert use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinError

func JoinError(errs ...error) error

Join returns an error that wraps the given errors. Any nil error values are discarded. Join returns nil if errs contains no non-nil values. The error formats as the concatenation of the strings obtained by calling the Error method of each element of errs, with a newline between each string.

Types

type Assert

type Assert struct {
	T        *testing.T
	CaseName string
}

Assert is a simple implementation of assertion, only for assert usage

func NewAssert

func NewAssert(t *testing.T, caseName string) *Assert

NewAssert return instance of Assert

func (*Assert) Equal

func (a *Assert) Equal(expected, actual any)

Equal check if expected is equal with actual

func (*Assert) Greater

func (a *Assert) Greater(expected, actual any)

Greater check if expected is greate than actual

func (*Assert) GreaterOrEqual

func (a *Assert) GreaterOrEqual(expected, actual any)

GreaterOrEqual check if expected is greate than or equal with actual

func (*Assert) IsNil

func (a *Assert) IsNil(v any)

IsNil check if value is nil

func (*Assert) IsNotNil

func (a *Assert) IsNotNil(v any)

IsNotNil check if value is not nil

func (*Assert) Less

func (a *Assert) Less(expected, actual any)

Less check if expected is less than actual

func (*Assert) LessOrEqual

func (a *Assert) LessOrEqual(expected, actual any)

LessOrEqual check if expected is less than or equal with actual

func (*Assert) NotEqual

func (a *Assert) NotEqual(expected, actual any)

NotEqual check if expected is not equal with actual

Jump to

Keyboard shortcuts

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