(t *testing.T)
| 268 | } |
| 269 | |
| 270 | func TestParseMarkdownPRD_File(t *testing.T) { |
| 271 | tmpDir := t.TempDir() |
| 272 | prdPath := filepath.Join(tmpDir, "prd.md") |
| 273 | |
| 274 | md := `# Test |
| 275 | |
| 276 | ### US-001: First Story |
| 277 | - [ ] Works |
| 278 | ` |
| 279 | if err := os.WriteFile(prdPath, []byte(md), 0644); err != nil { |
| 280 | t.Fatalf("failed to write: %v", err) |
| 281 | } |
| 282 | |
| 283 | p, err := ParseMarkdownPRD(prdPath) |
| 284 | if err != nil { |
| 285 | t.Fatalf("ParseMarkdownPRD() error = %v", err) |
| 286 | } |
| 287 | if p.Project != "Test" { |
| 288 | t.Errorf("Project = %q", p.Project) |
| 289 | } |
| 290 | if len(p.UserStories) != 1 { |
| 291 | t.Fatalf("len(UserStories) = %d", len(p.UserStories)) |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | func TestParseMarkdownPRD_FileNotFound(t *testing.T) { |
| 296 | _, err := ParseMarkdownPRD("/nonexistent/prd.md") |
nothing calls this directly
no test coverage detected