|
|
|
@ -2051,6 +2051,12 @@ func TestPostingsForMatchers(t *testing.T) {
|
|
|
|
|
labels.FromStrings("n", "2"),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
matchers: []*labels.Matcher{labels.MustNewMatcher(labels.MatchNotRegexp, "n", "(1|2.5)")},
|
|
|
|
|
exp: []labels.Labels{
|
|
|
|
|
labels.FromStrings("n", "2"),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
matchers: []*labels.Matcher{labels.MustNewMatcher(labels.MatchEqual, "n", "1"), labels.MustNewMatcher(labels.MatchNotRegexp, "i", "^a$")},
|
|
|
|
|
exp: []labels.Labels{
|
|
|
|
@ -2112,6 +2118,13 @@ func TestPostingsForMatchers(t *testing.T) {
|
|
|
|
|
labels.FromStrings("n", "1", "i", "b"),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
matchers: []*labels.Matcher{labels.MustNewMatcher(labels.MatchRegexp, "i", "(a|b)")},
|
|
|
|
|
exp: []labels.Labels{
|
|
|
|
|
labels.FromStrings("n", "1", "i", "a"),
|
|
|
|
|
labels.FromStrings("n", "1", "i", "b"),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
matchers: []*labels.Matcher{labels.MustNewMatcher(labels.MatchRegexp, "n", "x1|2")},
|
|
|
|
|
exp: []labels.Labels{
|
|
|
|
@ -2134,6 +2147,14 @@ func TestPostingsForMatchers(t *testing.T) {
|
|
|
|
|
labels.FromStrings("n", "2.5"),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
matchers: []*labels.Matcher{labels.MustNewMatcher(labels.MatchRegexp, "i", "(c||d)")},
|
|
|
|
|
exp: []labels.Labels{
|
|
|
|
|
labels.FromStrings("n", "1"),
|
|
|
|
|
labels.FromStrings("n", "2"),
|
|
|
|
|
labels.FromStrings("n", "2.5"),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ir, err := h.Index()
|
|
|
|
|