Harden tests for bad arrays

This commit is contained in:
Thomas Pelletier
2015-09-09 17:33:28 +01:00
parent 5753e884d0
commit 6b9002d8f9
2 changed files with 12 additions and 2 deletions
+10
View File
@@ -297,6 +297,16 @@ func TestUnterminatedArray(t *testing.T) {
if err.Error() != "(1, 8): unterminated array" {
t.Error("Bad error message:", err.Error())
}
_, err = Load("a = [1")
if err.Error() != "(1, 7): unterminated array" {
t.Error("Bad error message:", err.Error())
}
_, err = Load("a = [1 2")
if err.Error() != "(1, 8): missing comma" {
t.Error("Bad error message:", err.Error())
}
}
func TestNewlinesInArrays(t *testing.T) {