mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-27 22:49:40 -08:00
Merge pull request #13656 from prometheus/owilliams/quotetests
tests(utf8): confirm that other quote marks are handled correctly in promql
This commit is contained in:
commit
4408f898bc
|
@ -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"}`,
|
input: `{"foo", a="bc"}`,
|
||||||
expected: &VectorSelector{
|
expected: &VectorSelector{
|
||||||
|
|
Loading…
Reference in a new issue