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

Function TestContext_IncludeContent

apps/cli/internal/cli/context_test.go:339–367  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

337}
338
339func TestContext_IncludeContent(t *testing.T) {
340 tmpDir := createContextTestFiles(t)
341 resetContextFlags()
342 taskDir = tmpDir
343 setupTestConfig(t, tmpDir)
344
345 ctxTaskID = "002"
346 ctxFormat = "json"
347 ctxIncludeContent = true
348 output, err := captureContextOutput(t)
349 if err != nil {
350 t.Fatalf("unexpected error: %v", err)
351 }
352
353 var result taskcontext.Result
354 if err := json.Unmarshal([]byte(output), &result); err != nil {
355 t.Fatalf("failed to parse JSON: %v", err)
356 }
357
358 if result.TaskBody == "" {
359 t.Error("expected task_body with --include-content")
360 }
361
362 for _, f := range result.Files {
363 if f.Exists && f.Content == "" {
364 t.Errorf("expected content for existing file %s", f.Path)
365 }
366 }
367}
368
369func TestContext_IncludeContentText(t *testing.T) {
370 tmpDir := createContextTestFiles(t)

Callers

nothing calls this directly

Calls 5

createContextTestFilesFunction · 0.85
resetContextFlagsFunction · 0.85
setupTestConfigFunction · 0.85
captureContextOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected