(t *testing.T)
| 346 | } |
| 347 | |
| 348 | func 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 | |
| 370 | func TestNext_LimitExceedsAvailable(t *testing.T) { |
| 371 | tmpDir := createNextTestTaskFiles(t) |
nothing calls this directly
no test coverage detected