MCPcopy Create free account
hub / github.com/diillson/chatcli / TestAppendMemoryRound

Function TestAppendMemoryRound

cli/chat_memory_test.go:68–78  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestAppendMemoryRound(t *testing.T) {
69 hist, prompt := appendMemoryRound(
70 []models.Message{{Role: "system", Content: "sys"}},
71 "user request", `{"cmd":"profile"}`, "Profile updated: goals")
72 if len(hist) != 3 || hist[1].Content != "user request" || !strings.Contains(hist[2].Content, `{"cmd":"profile"}`) {
73 t.Fatalf("history shape wrong: %+v", hist)
74 }
75 if !strings.Contains(prompt, "Profile updated: goals") || !strings.Contains(prompt, "confirm to the user") {
76 t.Errorf("follow-up prompt = %q", prompt)
77 }
78}
79
80func TestChatMemoryXMLInstruction_HasFormat(t *testing.T) {
81 s := chatMemoryXMLInstruction()

Callers

nothing calls this directly

Calls 2

appendMemoryRoundFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected