Documentation
¶
Index ¶
- func CheckIRPattern(t *testing.T, ir string, pattern string)
- func CompileAndGetFunction(t *testing.T, src, funcName string) *ssa.Function
- func ComputeTopologySimilarityExported(topo *topology.FunctionTopology, sig detection.Signature) float64
- func FindResult(results []diff.FingerprintResult, Name string) *diff.FingerprintResult
- func FormatEntropyKeyExported(entropy float64, id string) string
- func GenerateTopologyHashExported(topo *topology.FunctionTopology) string
- func GetFunctionNames(results []diff.FingerprintResult) []string
- func MatchCallsExported(topo *topology.FunctionTopology, required []string) (score float64, matched, missing []string)
- func SetupTestEnv(t *testing.T, prefix string) (string, func())
- func ShortFuncName(fullName string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIRPattern ¶
CheckIRPattern checks IR against a pattern using regex, abstracting register names. Exported for use in external test packages.
func CompileAndGetFunction ¶
CompileAndGetFunction builds SSA from source and returns the requested function. This allows low-level analysis packages to be tested in isolation.
func ComputeTopologySimilarityExported ¶
func ComputeTopologySimilarityExported(topo *topology.FunctionTopology, sig detection.Signature) float64
ComputeTopologySimilarityExported exports the computeTopologySimilarity function for testing.
func FindResult ¶
func FindResult(results []diff.FingerprintResult, Name string) *diff.FingerprintResult
FindResult searches for a FingerprintResult by function name. It supports both exact matches and suffix matches (e.g., "functionName" matches "pkg.functionName"). Exported for use in external test packages.
func FormatEntropyKeyExported ¶
FormatEntropyKeyExported exports the formatEntropyKey function for testing.
func GenerateTopologyHashExported ¶
func GenerateTopologyHashExported(topo *topology.FunctionTopology) string
GenerateTopologyHashExported exports the generateTopologyHash function for testing.
func GetFunctionNames ¶
func GetFunctionNames(results []diff.FingerprintResult) []string
GetFunctionNames extracts function names from results for easier verification. Exported for use in external test packages.
func MatchCallsExported ¶
func MatchCallsExported(topo *topology.FunctionTopology, required []string) (score float64, matched, missing []string)
MatchCallsExported exports the matchCalls function for testing.
func SetupTestEnv ¶
SetupTestEnv creates an isolated workspace with a valid go.mod. Returns the directory path and a cleanup function.
func ShortFuncName ¶
ShortFuncName returns the short function name without package prefix. Exported for use in external test packages.
Types ¶
This section is empty.