(t *testing.T)
| 66 | } |
| 67 | |
| 68 | func 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 | |
| 80 | func TestChatMemoryXMLInstruction_HasFormat(t *testing.T) { |
| 81 | s := chatMemoryXMLInstruction() |
nothing calls this directly
no test coverage detected