test

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 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.

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)的值

Jump to

Keyboard shortcuts

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