(t *testing.T)
| 430 | } |
| 431 | |
| 432 | func TestContext_MaxFiles(t *testing.T) { |
| 433 | tmpDir := createContextTestFiles(t) |
| 434 | resetContextFlags() |
| 435 | taskDir = tmpDir |
| 436 | setupTestConfig(t, tmpDir) |
| 437 | |
| 438 | ctxTaskID = "003" |
| 439 | ctxFormat = "json" |
| 440 | ctxMaxFiles = 1 |
| 441 | output, err := captureContextOutput(t) |
| 442 | if err != nil { |
| 443 | t.Fatalf("unexpected error: %v", err) |
| 444 | } |
| 445 | |
| 446 | var result taskcontext.Result |
| 447 | if err := json.Unmarshal([]byte(output), &result); err != nil { |
| 448 | t.Fatalf("failed to parse JSON: %v", err) |
| 449 | } |
| 450 | |
| 451 | if len(result.Files) != 1 { |
| 452 | t.Errorf("expected 1 file (capped), got %d", len(result.Files)) |
| 453 | } |
| 454 | } |
| 455 | |
| 456 | func TestContext_InvalidFormat(t *testing.T) { |
| 457 | tmpDir := createContextTestFiles(t) |
nothing calls this directly
no test coverage detected