test

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package test 兼容性测试、跨包结构测试工具类

Index

Constants

This section is empty.

Variables

View Source
var GlobalVar = 1

GlobalVar 用于测试全局变量 mock

Functions

func Foo

func Foo(i int) int

Foo foo 测试函数

func GetS

func GetS() ([]byte, error)

GetS 测试返回多参返回值

func Invokefoo

func Invokefoo(i int) int

Invokefoo foo 测试调用未导出函数

func NewUnexportedFake

func NewUnexportedFake() *fake

NewUnexportedFake 构建未导出fake nolint

func Run

func Run(version string, logHandler func(log string), args ...string) error

Run runs the "go" tool of the provided Go version.

func UnexportedGlobalArrConst added in v1.0.5

func UnexportedGlobalArrConst() []int

UnexportedGlobalArrConst 获取未导出数组全局常量

func UnexportedGlobalArrVar added in v1.0.5

func UnexportedGlobalArrVar() []int

UnexportedGlobalArrVar 获取未导出数组全局变量

func UnexportedGlobalIntConst added in v1.0.5

func UnexportedGlobalIntConst() int

UnexportedGlobalIntConst 获取未导出Int全局常量

func UnexportedGlobalIntVar added in v1.0.5

func UnexportedGlobalIntVar() int

UnexportedGlobalIntVar 获取未导出Int全局变量

func UnexportedGlobalMapConst added in v1.0.5

func UnexportedGlobalMapConst() map[string]int

UnexportedGlobalMapConst 获取未导出map全局常量

func UnexportedGlobalMapVar added in v1.0.5

func UnexportedGlobalMapVar() map[string]int

UnexportedGlobalMapVar 获取未导出map全局变量

func UnexportedGlobalStrConst added in v1.0.5

func UnexportedGlobalStrConst() string

UnexportedGlobalStrConst 获取未导出Str全局常量

func UnexportedGlobalStrVar added in v1.0.5

func UnexportedGlobalStrVar() string

UnexportedGlobalStrVar 获取未导出Str全局变量

Types

type Fake

type Fake struct{}

Fake 导出结构体

func (*Fake) Call

func (f *Fake) Call(i int) int

Call 普通方法

func (*Fake) Call2

func (f *Fake) Call2(i int) int

Call2 普通方法

func (*Fake) Invokecall

func (f *Fake) Invokecall(i int) int

Invokecall 测试调用未导出函数

type S

type S struct {
	Field1 string
	Field2 int
}

S 测试返回复杂类型

func Foo1

func Foo1() *S

Foo1 foo1 测试函数返回复杂类型

type S1

type S1 struct {
	Field1 string
	Field2 int
}

S1 测试返回同等结构(不同Type)的值

type Struct added in v1.0.5

type Struct struct {
	Field1 string
}

func UnexportedGlobalStructPointerVar added in v1.0.5

func UnexportedGlobalStructPointerVar() *Struct

UnexportedGlobalStructPointerVar 获取未导出结构体引用全局变量

func UnexportedGlobalStructVar added in v1.0.5

func UnexportedGlobalStructVar() Struct

UnexportedGlobalStructVar 获取未导出结构体全局变量

Jump to

Keyboard shortcuts

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