(t *testing.T)
| 219 | } |
| 220 | |
| 221 | func createStatsPhaseTestFiles(t *testing.T) string { |
| 222 | t.Helper() |
| 223 | tmpDir := t.TempDir() |
| 224 | |
| 225 | tasks := map[string]string{ |
| 226 | "001.md": `--- |
| 227 | id: "001" |
| 228 | title: "V0.2 task A" |
| 229 | status: pending |
| 230 | priority: high |
| 231 | phase: v0.2 |
| 232 | ---`, |
| 233 | "002.md": `--- |
| 234 | id: "002" |
| 235 | title: "V0.2 task B" |
| 236 | status: completed |
| 237 | priority: medium |
| 238 | phase: v0.2 |
| 239 | ---`, |
| 240 | "003.md": `--- |
| 241 | id: "003" |
| 242 | title: "V0.3 task" |
| 243 | status: pending |
| 244 | priority: low |
| 245 | phase: v0.3 |
| 246 | ---`, |
| 247 | "004.md": `--- |
| 248 | id: "004" |
| 249 | title: "No phase" |
| 250 | status: pending |
| 251 | priority: medium |
| 252 | ---`, |
| 253 | } |
| 254 | |
| 255 | for filename, content := range tasks { |
| 256 | if err := os.WriteFile(filepath.Join(tmpDir, filename), []byte(content), 0644); err != nil { |
| 257 | t.Fatalf("failed to create test file %s: %v", filename, err) |
| 258 | } |
| 259 | } |
| 260 | return tmpDir |
| 261 | } |
| 262 | |
| 263 | func TestRunStats_GroupByPhase_Table(t *testing.T) { |
| 264 | tmpDir := createStatsPhaseTestFiles(t) |
no outgoing calls
no test coverage detected