Don't allow tables to be redefined

This commit is contained in:
Thomas Pelletier
2013-12-10 16:10:26 +01:00
parent 72f17747a0
commit 8081f3cc09
3 changed files with 22 additions and 0 deletions
+7
View File
@@ -196,6 +196,13 @@ func TestArrayWithExtraCommaComment(t *testing.T) {
})
}
func TestDuplicateGroups(t *testing.T) {
_, err := Load("[foo]\na=2\n[foo]b=3")
if err.Error() != "duplicated tables" {
t.Error("Bad error message:", err.Error())
}
}
func TestMissingFile(t *testing.T) {
_, err := LoadFile("foo.toml")
if err.Error() != "open foo.toml: no such file or directory" {