MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / createTestPRD

Function createTestPRD

internal/loop/loop_test.go:65–83  ·  view source on GitHub ↗

createTestPRD creates a minimal test PRD markdown file.

(t *testing.T, dir string, allComplete bool)

Source from the content-addressed store, hash-verified

63
64// createTestPRD creates a minimal test PRD markdown file.
65func 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
85func TestNewLoop(t *testing.T) {
86 l := NewLoop("/path/to/prd.json", "test prompt", 5, testProvider)

Callers 4

TestLoop_MaxIterationsFunction · 0.85
TestLoop_LogFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected