MCPcopy Create free account
hub / github.com/driangle/taskmd / TestRunStats_EmptyDir

Function TestRunStats_EmptyDir

apps/cli/internal/cli/stats_test.go:167–185  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

165}
166
167func TestRunStats_EmptyDir(t *testing.T) {
168 tmpDir := t.TempDir()
169 resetStatsFlags()
170 statsFormat = "json"
171
172 output, err := captureStatsOutput(t, []string{tmpDir})
173 if err != nil {
174 t.Fatalf("runStats failed: %v", err)
175 }
176
177 var m metrics.Metrics
178 if err := json.Unmarshal([]byte(output), &m); err != nil {
179 t.Fatalf("failed to parse JSON: %v\noutput: %s", err, output)
180 }
181
182 if m.TotalTasks != 0 {
183 t.Errorf("total_tasks = %d, want 0", m.TotalTasks)
184 }
185}
186
187func TestOutputStatsTable_EmptyBreakdowns(t *testing.T) {
188 m := &metrics.Metrics{

Callers

nothing calls this directly

Calls 2

resetStatsFlagsFunction · 0.85
captureStatsOutputFunction · 0.85

Tested by

no test coverage detected