mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Make sure special chars ok in key names
This commit is contained in:
@@ -439,3 +439,21 @@ func TestMapQuotedKeys(t *testing.T) {
|
||||
lx = lex("foo = {\"bar\" = 4242}")
|
||||
expect(t, lx, expectedItems)
|
||||
}
|
||||
|
||||
func TestSpecialCharsMapQuotedKeys(t *testing.T) {
|
||||
expectedItems := []item{
|
||||
{itemKey, "foo", 1},
|
||||
{itemMapStart, "", 1},
|
||||
{itemKey, "bar-1.2.3", 1},
|
||||
{itemMapStart, "", 1},
|
||||
{itemKey, "port", 1},
|
||||
{itemInteger, "4242", 1},
|
||||
{itemMapEnd, "", 1},
|
||||
{itemMapEnd, "", 1},
|
||||
{itemEOF, "", 1},
|
||||
}
|
||||
lx := lex("foo = {'bar-1.2.3' = { port:4242 }}")
|
||||
expect(t, lx, expectedItems)
|
||||
lx = lex("foo = {\"bar-1.2.3\" = { port:4242 }}")
|
||||
expect(t, lx, expectedItems)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user