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

Function TestAppendKnowledgeRound

cli/chat_knowledge_test.go:70–80  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func TestAppendKnowledgeRound(t *testing.T) {
71 hist, prompt := appendKnowledgeRound(
72 []models.Message{{Role: "system", Content: "sys"}},
73 "user question", `{"cmd":"search"}`, "the passages")
74 if len(hist) != 3 || hist[1].Content != "user question" || !strings.Contains(hist[2].Content, `{"cmd":"search"}`) {
75 t.Fatalf("history shape wrong: %+v", hist)
76 }
77 if !strings.Contains(prompt, "the passages") || !strings.Contains(prompt, "cite source paths") {
78 t.Errorf("follow-up prompt = %q", prompt)
79 }
80}
81
82func TestChatKnowledgeXMLInstruction_HasFormat(t *testing.T) {
83 s := chatKnowledgeXMLInstruction()

Callers

nothing calls this directly

Calls 2

appendKnowledgeRoundFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected