Benchmark tests
(b *testing.B)
| 322 | |
| 323 | // Benchmark tests |
| 324 | func BenchmarkExtractWorkflowNameFromFile(b *testing.B) { |
| 325 | // Create temporary test file |
| 326 | tmpDir := b.TempDir() |
| 327 | content := `--- |
| 328 | title: Test Workflow |
| 329 | --- |
| 330 | |
| 331 | # Daily Test Coverage Improvement |
| 332 | |
| 333 | This is a test workflow with some content.` |
| 334 | |
| 335 | filePath := filepath.Join(tmpDir, "test-workflow.md") |
| 336 | err := os.WriteFile(filePath, []byte(content), 0644) |
| 337 | if err != nil { |
| 338 | b.Fatalf("Failed to create test file: %v", err) |
| 339 | } |
| 340 | |
| 341 | for b.Loop() { |
| 342 | _, _ = extractWorkflowNameFromFile(filePath) |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | func BenchmarkFindIncludesInContent(b *testing.B) { |
| 347 | content := `This is content with includes: |
nothing calls this directly
no test coverage detected