add test for trailing comma in inline table (#366)

Fixes #359
This commit is contained in:
Allen
2020-04-25 09:43:46 +08:00
committed by GitHub
parent e9e8265313
commit 947ab3f90a
+7
View File
@@ -696,6 +696,13 @@ func TestInlineTableDoubleComma(t *testing.T) {
}
}
func TestInlineTableTrailingComma(t *testing.T) {
_, err := Load("foo = {hello = 53, foo = 17,}")
if err.Error() != "(1, 28): trailing comma at the end of inline table" {
t.Error("Bad error message:", err.Error())
}
}
func TestDuplicateGroups(t *testing.T) {
_, err := Load("[foo]\na=2\n[foo]b=3")
if err.Error() != "(3, 2): duplicated tables" {