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
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
1 changed files with 7 additions and 0 deletions

View File

@ -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)$",