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

Function TestStatus_NoBodyInOutput

apps/cli/internal/cli/status_test.go:510–534  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

508}
509
510func TestStatus_NoBodyInOutput(t *testing.T) {
511 tmpDir := createStatusTestFiles(t)
512 resetStatusFlags()
513 taskDir = tmpDir
514
515 // Text format
516 output := captureStatusOutput(t, "001")
517 if strings.Contains(output, "Initial project setup") {
518 t.Error("Text output should not contain task body")
519 }
520
521 // JSON format
522 resetStatusFlags()
523 taskDir = tmpDir
524 statusFormat = "json"
525 output = captureStatusOutput(t, "001")
526
527 var raw map[string]any
528 if err := json.Unmarshal([]byte(output), &raw); err != nil {
529 t.Fatalf("Failed to parse JSON: %v", err)
530 }
531 if _, ok := raw["content"]; ok {
532 t.Error("JSON should not have 'content' field")
533 }
534}
535
536// captureStatusNoArgsOutput runs status with no arguments and captures stdout.
537func captureStatusNoArgsOutput(t *testing.T) (string, error) {

Callers

nothing calls this directly

Calls 4

createStatusTestFilesFunction · 0.85
resetStatusFlagsFunction · 0.85
captureStatusOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected