Improve error checking on number parsing

This commit is contained in:
Thomas Pelletier
2015-12-01 14:38:33 +01:00
parent fa1c2ab68c
commit 6d743bb19f
4 changed files with 56 additions and 3 deletions
+9
View File
@@ -618,3 +618,12 @@ func TestKeyNewline(t *testing.T) {
token{Position{1, 1}, tokenError, "keys cannot contain new lines"},
})
}
func TestInvalidFloat(t *testing.T) {
testFlow(t, "a=7e1_", []token{
token{Position{1, 1}, tokenKey, "a"},
token{Position{1, 2}, tokenEqual, "="},
token{Position{1, 3}, tokenFloat, "7e1_"},
token{Position{1, 7}, tokenEOF, ""},
})
}