MCPcopy
hub / github.com/google/mangle / TestTemporalFactStoreAdapter_Add

Function TestTemporalFactStoreAdapter_Add

factstore/temporal_test.go:484–500  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

482}
483
484func TestTemporalFactStoreAdapter_Add(t *testing.T) {
485 temporal := NewTemporalStore()
486 adapter := NewTemporalFactStoreAdapter(temporal)
487
488 atom := ast.NewAtom("admin", name("/charlie"))
489
490 // Add through adapter should create eternal fact
491 if !adapter.Add(atom) {
492 t.Error("Adapter.Add should return true")
493 }
494
495 // Should be queryable at any time
496 testTime := ast.Date(2024, 6, 15)
497 if !temporal.ContainsAt(atom, testTime) {
498 t.Error("Fact added through adapter should be eternal")
499 }
500}
501
502func TestTemporalStore_ListPredicates(t *testing.T) {
503 store := NewTemporalStore()

Callers

nothing calls this directly

Calls 8

AddMethod · 0.95
ContainsAtMethod · 0.95
NewAtomFunction · 0.92
DateFunction · 0.92
NewTemporalStoreFunction · 0.85
ErrorMethod · 0.80
nameFunction · 0.70

Tested by

no test coverage detected