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

Function TestTemporalStore_ListPredicates

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

Source from the content-addressed store, hash-verified

500}
501
502func TestTemporalStore_ListPredicates(t *testing.T) {
503 store := NewTemporalStore()
504
505 store.Add(ast.NewAtom("foo", name("/a")), ast.EternalInterval())
506 store.Add(ast.NewAtom("bar", name("/b")), ast.EternalInterval())
507 store.Add(ast.NewAtom("baz", name("/c")), ast.EternalInterval())
508
509 preds := store.ListPredicates()
510 if len(preds) != 3 {
511 t.Errorf("ListPredicates returned %d predicates, want 3", len(preds))
512 }
513
514 // Check that all predicates are present
515 found := make(map[string]bool)
516 for _, p := range preds {
517 found[p.Symbol] = true
518 }
519
520 for _, expected := range []string{"foo", "bar", "baz"} {
521 if !found[expected] {
522 t.Errorf("ListPredicates missing %s", expected)
523 }
524 }
525}

Callers

nothing calls this directly

Calls 6

AddMethod · 0.95
ListPredicatesMethod · 0.95
NewAtomFunction · 0.92
EternalIntervalFunction · 0.92
NewTemporalStoreFunction · 0.85
nameFunction · 0.70

Tested by

no test coverage detected