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

Function TestNext_LimitFlag

apps/cli/internal/cli/next_test.go:348–368  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

346}
347
348func TestNext_LimitFlag(t *testing.T) {
349 tmpDir := createNextTestTaskFiles(t)
350
351 resetNextFlags()
352 nextFormat = "json"
353 nextLimit = 2
354
355 output, err := captureNextOutput(t, []string{tmpDir})
356 if err != nil {
357 t.Fatalf("runNext failed: %v", err)
358 }
359
360 var recs []Recommendation
361 if err := json.Unmarshal([]byte(output), &recs); err != nil {
362 t.Fatalf("Failed to parse JSON: %v", err)
363 }
364
365 if len(recs) != 2 {
366 t.Errorf("Expected 2 recommendations with --limit 2, got %d", len(recs))
367 }
368}
369
370func TestNext_LimitExceedsAvailable(t *testing.T) {
371 tmpDir := createNextTestTaskFiles(t)

Callers

nothing calls this directly

Calls 3

createNextTestTaskFilesFunction · 0.85
resetNextFlagsFunction · 0.85
captureNextOutputFunction · 0.85

Tested by

no test coverage detected