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

Function TestGetPrompt

embed/embed_test.go:8–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func TestGetPrompt(t *testing.T) {
9 progressPath := "/path/to/progress.md"
10 storyContext := `{"id":"US-001","title":"Test Story"}`
11 prompt := GetPrompt(progressPath, storyContext, "US-001", "Test Story")
12
13 // Verify all placeholders were substituted
14 if strings.Contains(prompt, "{{PROGRESS_PATH}}") {
15 t.Error("Expected {{PROGRESS_PATH}} to be substituted")
16 }
17 if strings.Contains(prompt, "{{STORY_CONTEXT}}") {
18 t.Error("Expected {{STORY_CONTEXT}} to be substituted")
19 }
20 if strings.Contains(prompt, "{{STORY_ID}}") {
21 t.Error("Expected {{STORY_ID}} to be substituted")
22 }
23 if strings.Contains(prompt, "{{STORY_TITLE}}") {
24 t.Error("Expected {{STORY_TITLE}} to be substituted")
25 }
26
27 // Verify the commit message contains the exact story ID and title
28 if !strings.Contains(prompt, "feat: US-001 - Test Story") {
29 t.Error("Expected prompt to contain exact commit message 'feat: US-001 - Test Story'")
30 }
31
32 // Verify the progress path appears in the prompt
33 if !strings.Contains(prompt, progressPath) {
34 t.Errorf("Expected prompt to contain progress path %q", progressPath)
35 }
36
37 // Verify the story context is inlined in the prompt
38 if !strings.Contains(prompt, storyContext) {
39 t.Error("Expected prompt to contain inlined story context")
40 }
41
42 // Verify the prompt contains chief-done stop condition
43 if !strings.Contains(prompt, "chief-done") {
44 t.Error("Expected prompt to contain chief-done instruction")
45 }
46}
47
48func TestGetPrompt_NoFileReadInstruction(t *testing.T) {
49 prompt := GetPrompt("/path/progress.md", `{"id":"US-001"}`, "US-001", "Test Story")

Callers

nothing calls this directly

Calls 1

GetPromptFunction · 0.85

Tested by

no test coverage detected