(t *testing.T)
| 228 | } |
| 229 | |
| 230 | func TestProjects_YAMLOutput(t *testing.T) { |
| 231 | resetProjectsFlags() |
| 232 | projectsFormat = "yaml" |
| 233 | |
| 234 | projectDir := createProjectWithTasks(t, "tasks", map[string]string{ |
| 235 | "001.md": taskFile("001", "Task A", "completed"), |
| 236 | }) |
| 237 | |
| 238 | setupGlobalRegistry(t, "projects:\n"+ |
| 239 | " - id: proj1\n"+ |
| 240 | " name: \"YAML Project\"\n"+ |
| 241 | " path: "+projectDir+"\n") |
| 242 | |
| 243 | stdout, _, err := captureProjectsOutput(t) |
| 244 | if err != nil { |
| 245 | t.Fatalf("unexpected error: %v", err) |
| 246 | } |
| 247 | |
| 248 | if !strings.Contains(stdout, "name: YAML Project") { |
| 249 | t.Errorf("expected YAML output with project name, got:\n%s", stdout) |
| 250 | } |
| 251 | if !strings.Contains(stdout, "completed: 1") { |
| 252 | t.Errorf("expected YAML output with completed count, got:\n%s", stdout) |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | func TestProjects_DefaultTaskDir(t *testing.T) { |
| 257 | resetProjectsFlags() |
nothing calls this directly
no test coverage detected