Accept spaces in keys

This commit is contained in:
Thomas Pelletier
2015-07-16 23:04:13 -07:00
parent 8fc7451ffc
commit 894e775e38
3 changed files with 66 additions and 0 deletions
+9
View File
@@ -39,6 +39,15 @@ func TestValidKeyGroup(t *testing.T) {
})
}
func TestNestedQuotedUnicodeKeyGroup(t *testing.T) {
testFlow(t, `[ j . "ʞ" . l ]`, []token{
token{Position{1, 1}, tokenLeftBracket, "["},
token{Position{1, 2}, tokenKeyGroup, ` j . "ʞ" . l `},
token{Position{1, 15}, tokenRightBracket, "]"},
token{Position{1, 16}, tokenEOF, ""},
})
}
func TestUnclosedKeyGroup(t *testing.T) {
testFlow(t, "[hello world", []token{
token{Position{1, 1}, tokenLeftBracket, "["},