mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Add tests to specify the string escaping behavior
This commit is contained in:
parent
5b78fdd6b7
commit
907b1380a7
|
@ -99,6 +99,26 @@ var tests = []struct {
|
||||||
input: "0x123",
|
input: "0x123",
|
||||||
expected: []item{{itemNumber, 0, "0x123"}},
|
expected: []item{{itemNumber, 0, "0x123"}},
|
||||||
},
|
},
|
||||||
|
// Test strings.
|
||||||
|
{
|
||||||
|
input: "\"test\\tsecuence\"",
|
||||||
|
expected: []item{{itemString, 0, `"test\tsecuence"`}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "\"test\\\\.expression\"",
|
||||||
|
expected: []item{{itemString, 0, `"test\\.expression"`}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "\"test\\.expression\"",
|
||||||
|
expected: []item{
|
||||||
|
{itemError, 0, "unknown escape sequence U+002E '.'"},
|
||||||
|
{itemString, 0, `"test\.expression"`},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "`test\\.expression`",
|
||||||
|
expected: []item{{itemString, 0, "`test\\.expression`"}},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// See https://github.com/prometheus/prometheus/issues/939.
|
// See https://github.com/prometheus/prometheus/issues/939.
|
||||||
input: ".٩",
|
input: ".٩",
|
||||||
|
|
Loading…
Reference in a new issue