(t *testing.T)
| 468 | } |
| 469 | |
| 470 | func TestVerify_Timeout(t *testing.T) { |
| 471 | tmpDir := t.TempDir() |
| 472 | |
| 473 | content := `--- |
| 474 | id: "010" |
| 475 | title: "Task with slow check" |
| 476 | status: pending |
| 477 | created: 2026-02-14 |
| 478 | verify: |
| 479 | - type: bash |
| 480 | run: "sleep 10" |
| 481 | --- |
| 482 | |
| 483 | # Task with slow check |
| 484 | ` |
| 485 | path := filepath.Join(tmpDir, "010-slow.md") |
| 486 | if err := os.WriteFile(path, []byte(content), 0644); err != nil { |
| 487 | t.Fatalf("Failed to create test file: %v", err) |
| 488 | } |
| 489 | |
| 490 | resetVerifyFlags() |
| 491 | taskDir = tmpDir |
| 492 | verifyTaskID = "010" |
| 493 | verifyTimeout = 1 |
| 494 | |
| 495 | output, err := captureVerifyOutput(t) |
| 496 | if err == nil { |
| 497 | t.Fatal("expected error for timeout") |
| 498 | } |
| 499 | if !errors.Is(err, ErrVerifyFailed) { |
| 500 | t.Fatalf("expected ErrVerifyFailed, got: %v", err) |
| 501 | } |
| 502 | |
| 503 | if !strings.Contains(output, "FAIL") { |
| 504 | t.Errorf("expected FAIL for timeout, got: %s", output) |
| 505 | } |
| 506 | } |
nothing calls this directly
no test coverage detected