(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestTemporalStore_AddEternal(t *testing.T) { |
| 76 | store := NewTemporalStore() |
| 77 | |
| 78 | atom := ast.NewAtom("admin", name("/bob")) |
| 79 | |
| 80 | added, err := store.AddEternal(atom) |
| 81 | if err != nil { |
| 82 | t.Errorf("AddEternal returned error: %v", err) |
| 83 | } |
| 84 | if !added { |
| 85 | t.Error("AddEternal should return true") |
| 86 | } |
| 87 | |
| 88 | // Query at any time should return the fact |
| 89 | testTimes := []time.Time{ |
| 90 | ast.Date(1900, 1, 1), |
| 91 | ast.Date(2024, 6, 15), |
| 92 | ast.Date(3000, 12, 31), |
| 93 | } |
| 94 | |
| 95 | for _, queryTime := range testTimes { |
| 96 | if !store.ContainsAt(atom, queryTime) { |
| 97 | t.Errorf("ContainsAt(%v) = false, want true for eternal fact", queryTime) |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | func TestTemporalStore_IntervalLimit(t *testing.T) { |
| 103 | // Use a small custom limit for faster testing |
nothing calls this directly
no test coverage detected