mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-21 03:16:00 -08:00
Add unit tests
Signed-off-by: Charles Korn <charles.korn@grafana.com>
This commit is contained in:
parent
96f31e370b
commit
026d0198d5
|
@ -1900,6 +1900,15 @@ func TestSubquerySelector(t *testing.T) {
|
||||||
},
|
},
|
||||||
Start: time.Unix(35, 0),
|
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 {
|
for name, testCase := range testCases {
|
||||||
|
|
Loading…
Reference in a new issue