Don't allow invalid escape sequences

This commit is contained in:
Thomas Pelletier
2013-12-10 17:34:11 +01:00
parent e8d5dbf787
commit a34fc5f051
2 changed files with 11 additions and 0 deletions
+8
View File
@@ -292,6 +292,14 @@ func TestDoubleEqualKey(t *testing.T) {
})
}
func TestInvalidEsquapeSequence(t *testing.T) {
testFlow(t, "foo = \"\\x\"", []token{
token{tokenKey, "foo"},
token{tokenEqual, "="},
token{tokenError, "invalid escape sequence: \\x"},
})
}
func TestKeyEqualNumber(t *testing.T) {
testFlow(t, "foo = 42", []token{
token{tokenKey, "foo"},