(t *testing.T)
| 337 | } |
| 338 | |
| 339 | func 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 | |
| 369 | func TestContext_IncludeContentText(t *testing.T) { |
| 370 | tmpDir := createContextTestFiles(t) |
nothing calls this directly
no test coverage detected