basic

package
v0.0.0-...-3f5828c Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EStruct

type EStruct = struct{}

空 结构体类型

type KMap

type KMap map[string]interface{}

key 为字符串的 map

type KSlice

type KSlice []string

string 类型的切片

func (KSlice) ToMap

func (s KSlice) ToMap() KStructMap

将字符串切片转换成值为空的 map

type KStructMap

type KStructMap map[string]EStruct

key 为字符串, value 为空结构的 map

func (KStructMap) ToSlice

func (m KStructMap) ToSlice() KSlice

将字符串切片转换成值为空的 map

type XzTesting

type XzTesting struct {
	Cs    []XzTestingCase
	Logic XzTestingLogic
}

测试逻辑统一结构

func NewTesting

func NewTesting() *XzTesting

创建测试逻辑

func (*XzTesting) AddCase

func (xt *XzTesting) AddCase(c XzTestingCase) *XzTesting

增加一个测试用例

func (*XzTesting) AppendCase

func (xt *XzTesting) AppendCase(cs []XzTestingCase) *XzTesting

批量增加测试用例

func (*XzTesting) Done

func (xt *XzTesting) Done(t *testing.T)

增加一个测试用例

func (*XzTesting) SetCases

func (xt *XzTesting) SetCases(cs []XzTestingCase) *XzTesting

设置测试用例

func (*XzTesting) SetLogic

func (xt *XzTesting) SetLogic(logic XzTestingLogic) *XzTesting

设置计算逻辑

type XzTestingCase

type XzTestingCase struct {
	Name string
	Args KMap
	Want KMap
}

测试用例统一结构

func (*XzTestingCase) Errorf

func (c *XzTestingCase) Errorf(res interface{}) string

统一测试错误输出

func (*XzTestingCase) Logf

func (c *XzTestingCase) Logf() string

统一测试错误输出

type XzTestingLogic

type XzTestingLogic func(args KMap) KMap

测试逻辑类型

Jump to

Keyboard shortcuts

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