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

Function TestVerify_FailFast

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

Source from the content-addressed store, hash-verified

377}
378
379func TestVerify_FailFast(t *testing.T) {
380 tmpDir := createVerifyTestFiles(t)
381 resetVerifyFlags()
382 taskDir = tmpDir
383 verifyTaskID = "008"
384
385 output, err := captureVerifyOutput(t)
386 if err == nil {
387 t.Fatal("expected error for failing check")
388 }
389 if !errors.Is(err, ErrVerifyFailed) {
390 t.Fatalf("expected ErrVerifyFailed, got: %v", err)
391 }
392
393 if !strings.Contains(output, "FAIL") {
394 t.Errorf("expected FAIL in output, got: %s", output)
395 }
396 if !strings.Contains(output, "SKIP") {
397 t.Errorf("expected SKIP for remaining steps, got: %s", output)
398 }
399 // With fail-fast, only 1 step should fail and 2 should be skipped (not passed)
400 if strings.Contains(output, "PASS") {
401 t.Errorf("expected no PASS with fail-fast, but got: %s", output)
402 }
403 if !strings.Contains(output, "1 failed") {
404 t.Errorf("expected '1 failed' in output, got: %s", output)
405 }
406 if !strings.Contains(output, "2 skipped") {
407 t.Errorf("expected '2 skipped' in output, got: %s", output)
408 }
409}
410
411func TestVerify_All(t *testing.T) {
412 tmpDir := createVerifyTestFiles(t)

Callers

nothing calls this directly

Calls 3

createVerifyTestFilesFunction · 0.85
resetVerifyFlagsFunction · 0.85
captureVerifyOutputFunction · 0.85

Tested by

no test coverage detected