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

Function TestVerify_JSON

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

Source from the content-addressed store, hash-verified

336}
337
338func TestVerify_JSON(t *testing.T) {
339 tmpDir := createVerifyTestFiles(t)
340 resetVerifyFlags()
341 taskDir = tmpDir
342 verifyTaskID = "001"
343 verifyFormat = "json"
344
345 out, err := captureVerifyOutputSeparate(t)
346 if err != nil {
347 t.Fatalf("unexpected error: %v", err)
348 }
349
350 var result verify.Result
351 if err := json.Unmarshal([]byte(out.stdout), &result); err != nil {
352 t.Fatalf("failed to parse JSON output: %v\nOutput: %s", err, out.stdout)
353 }
354
355 if result.Passed != 2 {
356 t.Errorf("expected 2 passed in JSON, got %d", result.Passed)
357 }
358 if len(result.Steps) != 2 {
359 t.Errorf("expected 2 steps in JSON, got %d", len(result.Steps))
360 }
361}
362
363func TestVerify_CustomDir(t *testing.T) {
364 tmpDir := createVerifyTestFiles(t)

Callers

nothing calls this directly

Calls 3

createVerifyTestFilesFunction · 0.85
resetVerifyFlagsFunction · 0.85

Tested by

no test coverage detected