(t *testing.T)
| 276 | } |
| 277 | |
| 278 | func TestCFileErrorHandling(t *testing.T) { |
| 279 | // Test with invalid build directory |
| 280 | generator := &Generator{ |
| 281 | BaseName: "test", |
| 282 | BuildDir: "/invalid/readonly/path", |
| 283 | Functions: []phpFunction{ |
| 284 | {Name: "test", ReturnType: phpVoid}, |
| 285 | }, |
| 286 | } |
| 287 | |
| 288 | cGen := cFileGenerator{generator} |
| 289 | err := cGen.generate() |
| 290 | assert.Error(t, err, "Expected error when writing to invalid directory") |
| 291 | } |
| 292 | |
| 293 | func TestCFileSpecialCharacters(t *testing.T) { |
| 294 | tests := []struct { |