mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
tests(utf8): confirm that other quote marks are handled correctly in promql
Signed-off-by: Owen Williams <owen.williams@grafana.com>
This commit is contained in:
parent
0474b0bc39
commit
ac51a8024c
|
@ -1731,6 +1731,34 @@ var testExpr = []struct {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
input: `{'foo\'bar', 'a\\dos\\path'='boo\\urns'}`,
|
||||
expected: &VectorSelector{
|
||||
// When a metric is named inside the braces, the Name field is not set.
|
||||
LabelMatchers: []*labels.Matcher{
|
||||
MustLabelMatcher(labels.MatchEqual, model.MetricNameLabel, `foo'bar`),
|
||||
MustLabelMatcher(labels.MatchEqual, `a\dos\path`, `boo\urns`),
|
||||
},
|
||||
PosRange: posrange.PositionRange{
|
||||
Start: 0,
|
||||
End: 40,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
input: `{'foo\'bar', ` + "`" + `a\dos\path` + "`" + `="boo"}`,
|
||||
expected: &VectorSelector{
|
||||
// When a metric is named inside the braces, the Name field is not set.
|
||||
LabelMatchers: []*labels.Matcher{
|
||||
MustLabelMatcher(labels.MatchEqual, model.MetricNameLabel, `foo'bar`),
|
||||
MustLabelMatcher(labels.MatchEqual, `a\dos\path`, "boo"),
|
||||
},
|
||||
PosRange: posrange.PositionRange{
|
||||
Start: 0,
|
||||
End: 32,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
input: `{"foo", a="bc"}`,
|
||||
expected: &VectorSelector{
|
||||
|
|
Loading…
Reference in a new issue