(t *testing.T)
| 210 | } |
| 211 | |
| 212 | func TestLineageGraph_RemoveMemory(t *testing.T) { |
| 213 | lg := NewLineageGraph() |
| 214 | |
| 215 | // Create parent-child relationship |
| 216 | lg.TrackMemory("parent", &LineageMetadata{ |
| 217 | ID: "parent", |
| 218 | CreatedAt: time.Now().Unix(), |
| 219 | }) |
| 220 | |
| 221 | lg.TrackMemory("child", &LineageMetadata{ |
| 222 | ID: "child", |
| 223 | DerivedFromIDs: []string{"parent"}, |
| 224 | CreatedAt: time.Now().Unix(), |
| 225 | }) |
| 226 | |
| 227 | // Remove child |
| 228 | lg.RemoveMemory("child") |
| 229 | |
| 230 | // Child should be gone |
| 231 | if lg.memoryMetadata["child"] != nil { |
| 232 | t.Error("Child memory should be removed from metadata") |
| 233 | } |
| 234 | |
| 235 | // Parent should no longer have child in its children list |
| 236 | if len(lg.parentToChildren["parent"]) != 0 { |
| 237 | t.Error("Parent should have no children after removal") |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | func TestLineageManager_TrackMemoryCreation(t *testing.T) { |
| 242 | lm := NewLineageManager() |
nothing calls this directly
no test coverage detected