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

Function TestVerify_All

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

Source from the content-addressed store, hash-verified

409}
410
411func TestVerify_All(t *testing.T) {
412 tmpDir := createVerifyTestFiles(t)
413 resetVerifyFlags()
414 taskDir = tmpDir
415 verifyTaskID = "008"
416 verifyAll = true
417
418 output, err := captureVerifyOutput(t)
419 if err == nil {
420 t.Fatal("expected error for failing check")
421 }
422 if !errors.Is(err, ErrVerifyFailed) {
423 t.Fatalf("expected ErrVerifyFailed, got: %v", err)
424 }
425
426 if !strings.Contains(output, "FAIL") {
427 t.Errorf("expected FAIL in output, got: %s", output)
428 }
429 // With --all, subsequent steps should run (PASS, not SKIP)
430 if !strings.Contains(output, "PASS") {
431 t.Errorf("expected PASS for subsequent steps with --all, got: %s", output)
432 }
433 if !strings.Contains(output, "1 failed") {
434 t.Errorf("expected '1 failed' in output, got: %s", output)
435 }
436 if !strings.Contains(output, "2 passed") {
437 t.Errorf("expected '2 passed' in output, got: %s", output)
438 }
439}
440
441func TestResolveProjectRoot_ReturnsAbsolutePath(t *testing.T) {
442 // resolveProjectRoot uses viper.ConfigFileUsed() to determine the project root.

Callers

nothing calls this directly

Calls 3

createVerifyTestFilesFunction · 0.85
resetVerifyFlagsFunction · 0.85
captureVerifyOutputFunction · 0.85

Tested by

no test coverage detected