(t *testing.T)
| 245 | } |
| 246 | |
| 247 | func TestGet_JSONFormat(t *testing.T) { |
| 248 | tmpDir := createGetTestFiles(t) |
| 249 | resetGetFlags() |
| 250 | taskDir = tmpDir |
| 251 | getFormat = "json" |
| 252 | |
| 253 | output := captureGetOutput(t, "002") |
| 254 | |
| 255 | var result getOutput |
| 256 | if err := json.Unmarshal([]byte(output), &result); err != nil { |
| 257 | t.Fatalf("Failed to parse JSON output: %v\nOutput: %s", err, output) |
| 258 | } |
| 259 | |
| 260 | if result.ID != "002" { |
| 261 | t.Errorf("Expected ID '002', got %q", result.ID) |
| 262 | } |
| 263 | if result.Title != "Implement authentication" { |
| 264 | t.Errorf("Expected title 'Implement authentication', got %q", result.Title) |
| 265 | } |
| 266 | if result.Status != "in-progress" { |
| 267 | t.Errorf("Expected status 'in-progress', got %q", result.Status) |
| 268 | } |
| 269 | if result.Content == "" { |
| 270 | t.Error("Expected non-empty content in JSON output") |
| 271 | } |
| 272 | if len(result.Dependencies.DependsOn) != 1 || result.Dependencies.DependsOn[0].ID != "001" { |
| 273 | t.Error("Expected depends_on to contain task 001") |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | func TestGet_YAMLFormat(t *testing.T) { |
| 278 | tmpDir := createGetTestFiles(t) |
nothing calls this directly
no test coverage detected