createTestPRD creates a minimal test PRD markdown file.
(t *testing.T, dir string, allComplete bool)
| 63 | |
| 64 | // createTestPRD creates a minimal test PRD markdown file. |
| 65 | func createTestPRD(t *testing.T, dir string, allComplete bool) string { |
| 66 | t.Helper() |
| 67 | |
| 68 | status := "" |
| 69 | checkbox := "- [ ] It works" |
| 70 | if allComplete { |
| 71 | status = "**Status:** done\n" |
| 72 | checkbox = "- [x] It works" |
| 73 | } |
| 74 | |
| 75 | md := fmt.Sprintf("# Test Project\n\nTest Description\n\n### US-001: Test Story\n%s%s\n", status, checkbox) |
| 76 | |
| 77 | prdPath := filepath.Join(dir, "prd.md") |
| 78 | if err := os.WriteFile(prdPath, []byte(md), 0644); err != nil { |
| 79 | t.Fatalf("Failed to create test PRD: %v", err) |
| 80 | } |
| 81 | |
| 82 | return prdPath |
| 83 | } |
| 84 | |
| 85 | func TestNewLoop(t *testing.T) { |
| 86 | l := NewLoop("/path/to/prd.json", "test prompt", 5, testProvider) |
no outgoing calls
no test coverage detected