ssatest

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: AGPL-3.0 Imports: 16 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 func(prog *ssaapi.Program) error,
	opt ...ssaapi.Option,
)

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 CheckParameterMember

func CheckParameterMember(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 CheckSyntaxFlow

func CheckSyntaxFlow(t *testing.T, code string, sf string, wants map[string][]string, opt ...ssaapi.Option)

func CheckSyntaxFlowContain

func CheckSyntaxFlowContain(t *testing.T, code string, sf string, wants map[string][]string, opt ...ssaapi.Option)

func CheckSyntaxFlowEx

func CheckSyntaxFlowEx(t *testing.T, code string, sf string, contain bool, wants map[string][]string, opt ...ssaapi.Option)

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, opt ...ssaapi.Option)

func MockSSA

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

func SetLanguage

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

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