ssatest

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(t *testing.T, code string, handler checkFunction, languages ...ssaapi.Language)

func CheckBottomUserCall_Contain

func CheckBottomUserCall_Contain(variable string, want []string, forceCheckLength ...bool) checkFunction

func CheckBottomUser_Contain

func CheckBottomUser_Contain(variable string, want []string, forceCheckLength ...bool) checkFunction

func CheckError

func CheckError(t *testing.T, tc TestCase)

func CheckFreeValue

func CheckFreeValue(t *testing.T, tc TestCase)

func CheckFunctionReturnType

func CheckFunctionReturnType(t *testing.T, code string, kind ssa.TypeKind)

func CheckMask

func CheckMask(t *testing.T, tc TestCase)

func CheckNoError

func CheckNoError(t *testing.T, code string, opt ...ssaapi.Option)

func CheckParameter

func CheckParameter(t *testing.T, tc TestCase)

func CheckParse

func CheckParse(t *testing.T, code string, opt ...ssaapi.Option)

func CheckPrintf

func CheckPrintf(t *testing.T, tc TestCase)

func CheckPrintlnValue

func CheckPrintlnValue(code string, want []string, t *testing.T)

--------------------- for test ---------------------

func CheckTestCase

func CheckTestCase(t *testing.T, tc TestCase)

func CheckTopDef_Contain

func CheckTopDef_Contain(variable string, want []string, forceCheckLength ...bool) checkFunction

func CheckTopDef_Equal

func CheckTopDef_Equal(variable string, want []string, forceCheckLength ...bool) checkFunction

func CheckType

func CheckType(t *testing.T, code string, kind ssa.TypeKind)

func MockSSA

func MockSSA(t *testing.T, src string)

func SetLanguage

func SetLanguage(lang ssaapi.Language, build ssaapi.Build)

Types

type ExampleInterface

type ExampleInterface interface {
	ExampleMethod()
}

===================== struct =====================

func GetExampleInterface

func GetExampleInterface() ExampleInterface

type ExampleStruct

type ExampleStruct struct {
	ExampleFieldFunction func()
}

func GetExampleStruct

func GetExampleStruct() ExampleStruct

func (ExampleStruct) ExampleMethod

func (a ExampleStruct) ExampleMethod()

type TestCase

type TestCase struct {
	Code        string
	Want        []string
	ExternValue map[string]any
	ExternLib   map[string]map[string]any
	Check       func(*ssaapi.Program, []string)
	Option      []ssaapi.Option
}

===================== test case ====================

Jump to

Keyboard shortcuts

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