(t *testing.T, content string, functions []phpFunction)
| 1257 | } |
| 1258 | |
| 1259 | func 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 |
| 1275 | func computeFileHash(t *testing.T, filename string) string { |
no test coverage detected