MCPcopy Create free account
hub / github.com/php/frankenphp / testGeneratedFileWrappers

Function testGeneratedFileWrappers

internal/extgen/gofile_test.go:1259–1272  ·  view source on GitHub ↗
(t *testing.T, content string, functions []phpFunction)

Source from the content-addressed store, hash-verified

1257}
1258
1259func testGeneratedFileWrappers(t *testing.T, content string, functions []phpFunction) {
1260 for _, fn := range functions {
1261 exportDirective := "//export go_" + fn.Name
1262 assert.Contains(t, content, exportDirective, "Generated file should contain export directive: %s", exportDirective)
1263
1264 wrapperFunc := "func go_" + fn.Name + "("
1265 assert.Contains(t, content, wrapperFunc, "Generated file should contain wrapper function: %s", wrapperFunc)
1266
1267 funcName := extractGoFunctionName(fn.GoFunction)
1268 if funcName != "" {
1269 assert.Contains(t, content, funcName+"(", "Generated wrapper should call original function: %s", funcName)
1270 }
1271 }
1272}
1273
1274// computeFileHash returns SHA256 hash of file
1275func computeFileHash(t *testing.T, filename string) string {

Callers 1

Calls 1

extractGoFunctionNameFunction · 0.85

Tested by

no test coverage detected