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

Function TestRunValidate_JSONFormat

apps/cli/internal/cli/validate_test.go:395–413  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

393}
394
395func TestRunValidate_JSONFormat(t *testing.T) {
396 tmpDir := createValidateTestFiles(t)
397 resetValidateFlags()
398 validateFormat = "json"
399
400 output, err := captureValidateOutput(t, []string{tmpDir})
401 if err != nil {
402 t.Fatalf("runValidate failed: %v", err)
403 }
404
405 var parsed validator.ValidationResult
406 if err := json.Unmarshal([]byte(output), &parsed); err != nil {
407 t.Fatalf("failed to parse JSON: %v\noutput: %s", err, output)
408 }
409
410 if parsed.TaskCount != 2 {
411 t.Errorf("task_count = %d, want 2", parsed.TaskCount)
412 }
413}
414
415func TestRunValidate_InvalidFormat(t *testing.T) {
416 tmpDir := createValidateTestFiles(t)

Callers

nothing calls this directly

Calls 3

createValidateTestFilesFunction · 0.85
resetValidateFlagsFunction · 0.85
captureValidateOutputFunction · 0.85

Tested by

no test coverage detected