mirror of https://github.com/prometheus/prometheus
Single literal regexp value testcase for querier
It's common to see queries like bar=~"foo" from machine generated queries in the fronted. These are not evaluated as regexps, but are a single-value-set, i.e. and equality matchings instead. This is just a testcase for a single-value case. Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>pull/8881/head
parent
2826fbeeb7
commit
6d99731303
|
@ -1513,6 +1513,13 @@ func TestFindSetMatches(t *testing.T) {
|
||||||
pattern string
|
pattern string
|
||||||
exp []string
|
exp []string
|
||||||
}{
|
}{
|
||||||
|
// Single value, coming from a `bar=~"foo"` selector.
|
||||||
|
{
|
||||||
|
pattern: "^(?:foo)$",
|
||||||
|
exp: []string{
|
||||||
|
"foo",
|
||||||
|
},
|
||||||
|
},
|
||||||
// Simple sets.
|
// Simple sets.
|
||||||
{
|
{
|
||||||
pattern: "^(?:foo|bar|baz)$",
|
pattern: "^(?:foo|bar|baz)$",
|
||||||
|
|
Loading…
Reference in New Issue