(t *testing.T)
| 284 | } |
| 285 | |
| 286 | func TestGenerateFuncTestFileParam(t *testing.T) { |
| 287 | fn := FuncSignature{ |
| 288 | Name: "readCSV", |
| 289 | Params: []FuncParam{{Name: "filePath", Type: "string"}}, |
| 290 | Returns: "([][]string, error)", |
| 291 | } |
| 292 | test := generateFuncTest(fn) |
| 293 | if !strings.Contains(test, "CreateTemp") { |
| 294 | t.Error("should create temp file for file path param") |
| 295 | } |
| 296 | if !strings.Contains(test, "readCSV(") { |
| 297 | t.Error("should call readCSV") |
| 298 | } |
| 299 | if !strings.Contains(test, "Alice") { |
| 300 | t.Error("should write test data") |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | func TestGenerateFuncTestNonFile(t *testing.T) { |
| 305 | fn := FuncSignature{ |
nothing calls this directly
no test coverage detected