diff --git a/conf/lex_test.go b/conf/lex_test.go index fc94d3c2..f146d424 100644 --- a/conf/lex_test.go +++ b/conf/lex_test.go @@ -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) +}