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

Function TestVerify_Timeout

apps/cli/internal/cli/verify_test.go:470–506  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

468}
469
470func TestVerify_Timeout(t *testing.T) {
471 tmpDir := t.TempDir()
472
473 content := `---
474id: "010"
475title: "Task with slow check"
476status: pending
477created: 2026-02-14
478verify:
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}

Callers

nothing calls this directly

Calls 2

resetVerifyFlagsFunction · 0.85
captureVerifyOutputFunction · 0.85

Tested by

no test coverage detected