dtest

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(value, expect interface{})

Assert 判断<value>和<expect>两个对象值是否相等

func AssertEQ

func AssertEQ(value, expect interface{})

AssertEQ 判断<value>和<expect>两个对象是否相等,必须值与类型都相等

func AssertGE

func AssertGE(value, expect interface{})

AssertGE 判断<value>的值是否大于等于<expect>的值

func AssertGT

func AssertGT(value, expect interface{})

AssertGT 判断<value>的值是否大于<expect>的值

func AssertIN

func AssertIN(value, expect interface{})

AssertIN 判断<expect>的值是否包含<value>的值

func AssertLE

func AssertLE(value, expect interface{})

AssertLE 判断<value>的值是否小于等于<expect>的值

func AssertLT

func AssertLT(value, expect interface{})

AssertLT 判断<value>的值是否小于<expect>的值

func AssertNE

func AssertNE(value, expect interface{})

AssertNE 判断<value>和<expect>的值是否相等,如果相等则报错

func AssertNI

func AssertNI(value, expect interface{})

AssertNI not in 判断<expect>的值是否包含<value>的值,如果包含则失败

func AssertNQ

func AssertNQ(value, expect interface{})

AssertNQ 判断<value>和<expect>的值和类型是否相等,如果相等则报错

func AssertNil added in v0.1.2

func AssertNil(value interface{})

AssertNil asserts `value` is nil.

func C

func C(t *testing.T, f func(t *T))

C 创建一个测试单元用例

func Case

func Case(t *testing.T, f func())

Case 创建一个单元测试用例

func Error

func Error(message ...interface{})

Error 产生错误

func Fatal

func Fatal(message ...interface{})

Fatal 输出错误,并退出

Types

type T

type T struct {
	*testing.T
}

T 是测试单元的管理对象

func (*T) Assert

func (that *T) Assert(value, expect interface{})

Assert 判断<value>和<expect>两个对象值是否相等

func (*T) AssertEQ

func (that *T) AssertEQ(value, expect interface{})

AssertEQ 判断<value>和<expect>两个对象是否相等,必须值与类型都相等

func (*T) AssertGE

func (that *T) AssertGE(value, expect interface{})

AssertGE 判断<value>的值是否大于等于<expect>的值

func (*T) AssertGT

func (that *T) AssertGT(value, expect interface{})

AssertGT 判断<value>的值是否大于<expect>的值

func (*T) AssertIN

func (that *T) AssertIN(value, expect interface{})

AssertIN 判断<expect>的值是否包含<value>的值

func (*T) AssertLE

func (that *T) AssertLE(value, expect interface{})

AssertLE 判断<value>的值是否小于等于<expect>的值

func (*T) AssertLT

func (that *T) AssertLT(value, expect interface{})

AssertLT 判断<value>的值是否小于<expect>的值

func (*T) AssertNE

func (that *T) AssertNE(value, expect interface{})

AssertNE 判断<value>和<expect>的值是否相等,如果相等则报错

func (*T) AssertNI

func (that *T) AssertNI(value, expect interface{})

AssertNI not in 判断<expect>的值是否包含<value>的值,如果包含则失败

func (*T) AssertNQ

func (that *T) AssertNQ(value, expect interface{})

AssertNQ 判断<value>和<expect>的值和类型是否相等,如果相等则报错

func (*T) AssertNil added in v0.1.2

func (that *T) AssertNil(value interface{})

func (*T) Error

func (that *T) Error(message ...interface{})

Error 产生错误

func (*T) Fatal

func (that *T) Fatal(message ...interface{})

Fatal 输出错误,并退出

Jump to

Keyboard shortcuts

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