(t *testing.T)
| 95 | } |
| 96 | |
| 97 | func 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 | |
| 116 | func TestGetMemoryContext_Empty(t *testing.T) { |
| 117 | ms := NewMemoryStore(t.TempDir(), testLogger()) |
nothing calls this directly
no test coverage detected