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

Function TestAppendLongTerm

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

Source from the content-addressed store, hash-verified

23}
24
25func TestAppendLongTerm(t *testing.T) {
26 dir := t.TempDir()
27 ms := NewMemoryStore(dir, testLogger())
28
29 _ = ms.WriteLongTerm("line1")
30 _ = ms.AppendLongTerm("line2")
31
32 content := ms.ReadLongTerm()
33 if !strings.Contains(content, "line1") || !strings.Contains(content, "line2") {
34 t.Errorf("expected both lines, got %q", content)
35 }
36}
37
38func TestReadLongTerm_NoFile(t *testing.T) {
39 ms := NewMemoryStore(t.TempDir(), testLogger())

Callers

nothing calls this directly

Calls 6

WriteLongTermMethod · 0.95
AppendLongTermMethod · 0.95
ReadLongTermMethod · 0.95
ErrorfMethod · 0.80
NewMemoryStoreFunction · 0.70
testLoggerFunction · 0.70

Tested by

no test coverage detected