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>
This commit is contained in:
Oleg Zaytsev 2021-06-01 09:57:48 +02:00
parent 2826fbeeb7
commit 6d99731303
No known key found for this signature in database
GPG key ID: 7E9FE9FD48F512EF

View file

@ -1513,6 +1513,13 @@ func TestFindSetMatches(t *testing.T) {
pattern string
exp []string
}{
// Single value, coming from a `bar=~"foo"` selector.
{
pattern: "^(?:foo)$",
exp: []string{
"foo",
},
},
// Simple sets.
{
pattern: "^(?:foo|bar|baz)$",