MCPcopy Create free account
hub / github.com/astercloud/aster / TestLineageGraph_TrackMemory

Function TestLineageGraph_TrackMemory

pkg/memory/lineage_test.go:9–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestLineageGraph_TrackMemory(t *testing.T) {
10 lg := NewLineageGraph()
11
12 metadata := &LineageMetadata{
13 ID: "mem-1",
14 SourceIDs: []string{"session-1"},
15 DerivedFromIDs: []string{},
16 CreatedAt: time.Now().Unix(),
17 }
18
19 lg.TrackMemory("mem-1", metadata)
20
21 if lg.memoryMetadata["mem-1"] == nil {
22 t.Error("Memory metadata not tracked")
23 }
24
25 if lg.memoryMetadata["mem-1"].ID != "mem-1" {
26 t.Errorf("Memory ID = %v, want mem-1", lg.memoryMetadata["mem-1"].ID)
27 }
28}
29
30func TestLineageGraph_GetDerivedMemories(t *testing.T) {
31 lg := NewLineageGraph()

Callers

nothing calls this directly

Calls 3

TrackMemoryMethod · 0.95
NewLineageGraphFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected