Add unit tests

Signed-off-by: Charles Korn <charles.korn@grafana.com>
This commit is contained in:
Charles Korn 2025-02-05 11:40:54 +11:00
parent 96f31e370b
commit 026d0198d5
No known key found for this signature in database

View file

@ -1900,6 +1900,15 @@ func TestSubquerySelector(t *testing.T) {
},
Start: time.Unix(35, 0),
},
{
Query: "metric[0:10s]",
Result: promql.Result{
nil,
promql.Matrix{},
nil,
},
Start: time.Unix(10, 0),
},
},
},
{
@ -3251,6 +3260,11 @@ func TestInstantQueryWithRangeVectorSelector(t *testing.T) {
},
},
},
"matches series but range is 0": {
expr: "some_metric[0]",
ts: baseT.Add(2 * time.Minute),
expected: promql.Matrix{},
},
}
for name, testCase := range testCases {