test

package
v0.0.0-...-1f8212d Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertArray

func AssertArray(handler *Handler)

func AssertFloat

func AssertFloat(handler *Handler)

func AssertMap

func AssertMap(handler *Handler)

func AssertStruct

func AssertStruct(handler *Handler)

func DefaultAssertEqual

func DefaultAssertEqual(handler *Handler)

func GetAssertArrayRange

func GetAssertArrayRange(start *int, end *int) func(*Handler)

func NewAssertConfig

func NewAssertConfig() *assertConfig

func NewTestHelper

func NewTestHelper(t *testing.T) *testHelper

NewTestHelper 断言工具构造函数

Types

type AssertError

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

AssertError 断言错误

func (*AssertError) String

func (err *AssertError) String() string

type Handler

type Handler struct {
	FullExpect interface{}
	FullActual interface{}

	FieldName string
	Expect    interface{}
	Actual    interface{}
	Ev        reflect.Value
	Av        reflect.Value
	// contains filtered or unexported fields
}

测试过程中用来表示一个测试对象

func (*Handler) Assert

func (h *Handler) Assert()

func (*Handler) AssertWithError

func (h *Handler) AssertWithError() (err interface{})

func (*Handler) ChangeValue

func (h *Handler) ChangeValue(expect, actual interface{})

func (*Handler) Child

func (h *Handler) Child(childName string, expect, actual interface{}) *Handler

func (*Handler) Error

func (h *Handler) Error(mesage string)

func (*Handler) IsOrdered

func (h *Handler) IsOrdered() bool

type IEqual

type IEqual interface {
	Equal(other interface{}) bool
}

Jump to

Keyboard shortcuts

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