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

Function TestGetMemoryContext

cli/workspace/memory_test.go:97–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95}
96
97func TestGetMemoryContext(t *testing.T) {
98 dir := t.TempDir()
99 ms := NewMemoryStore(dir, testLogger())
100
101 _ = ms.WriteLongTerm("# Memory\n- Important fact")
102 _ = ms.WriteDailyNote("Did something today")
103
104 ctx := ms.GetMemoryContext()
105 if !strings.Contains(ctx, "Long-term Memory") {
106 t.Error("expected 'Long-term Memory' section")
107 }
108 if !strings.Contains(ctx, "Important fact") {
109 t.Error("expected memory content")
110 }
111 if !strings.Contains(ctx, "Recent Activity") && !strings.Contains(ctx, "Daily Notes") {
112 t.Error("expected 'Recent Activity' or 'Daily Notes' section")
113 }
114}
115
116func TestGetMemoryContext_Empty(t *testing.T) {
117 ms := NewMemoryStore(t.TempDir(), testLogger())

Callers

nothing calls this directly

Calls 6

WriteLongTermMethod · 0.95
WriteDailyNoteMethod · 0.95
GetMemoryContextMethod · 0.95
NewMemoryStoreFunction · 0.70
testLoggerFunction · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected