(t *testing.T)
| 29 | } |
| 30 | |
| 31 | func TestTemporalGraphIntervals(t *testing.T) { |
| 32 | program := readExample(t, "temporal_graph_intervals.mg") |
| 33 | facts := runEvaluate(t, program) |
| 34 | |
| 35 | expected := []string{ |
| 36 | "reachable(/a,/b)", |
| 37 | "reachable(/b,/c)", |
| 38 | "reachable(/c,/d)", |
| 39 | "reachable(/a,/c)", |
| 40 | "reachable(/b,/d)", |
| 41 | } |
| 42 | |
| 43 | for _, want := range expected { |
| 44 | if !containsFact(facts, want) { |
| 45 | t.Errorf("Missing expected fact: %s", want) |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | // Verify specific intervals for interesting derived facts |
| 50 | // reachable(/a, /c) should be [2024-01-05, 2024-01-10] |
| 51 | // Start: max(Jan 1, Jan 5) = Jan 5 |
| 52 | // End: min(Jan 10, Jan 15) = Jan 10 |
| 53 | verifyInterval(t, facts, "reachable(/a,/c)", "2024-01-05", "2024-01-10") |
| 54 | |
| 55 | // reachable(/b, /d) should be [2024-01-12, 2024-01-15] |
| 56 | // Start: max(Jan 5, Jan 12) = Jan 12 |
| 57 | // End: min(Jan 15, Jan 20) = Jan 15 |
| 58 | verifyInterval(t, facts, "reachable(/b,/d)", "2024-01-12", "2024-01-15") |
| 59 | } |
| 60 | |
| 61 | func TestTemporalGraphPoints(t *testing.T) { |
| 62 | program := readExample(t, "temporal_graph_points.mg") |
nothing calls this directly
no test coverage detected