Fixes #20 : Creation of subgroup in table arrays

This commit is contained in:
Thomas Pelletier
2014-08-14 10:12:39 +02:00
parent 68d2a60b37
commit 65684e6bb0
3 changed files with 22 additions and 2 deletions
+10
View File
@@ -299,6 +299,16 @@ func TestParseKeyGroupArray(t *testing.T) {
})
}
func TestParseKeyGroupArraySpec(t *testing.T) {
tree, err := Load("[[fruit]]\n name=\"apple\"\n [fruit.physical]\n color=\"red\"\n shape=\"round\"\n [[fruit]]\n name=\"banana\"")
assertTree(t, tree, err, map[string]interface{}{
"fruit": []map[string]interface{}{
{"name": "apple", "physical": map[string]interface{}{"color": "red", "shape": "round"}},
{"name": "banana"},
},
})
}
func TestToTomlValue(t *testing.T) {
for idx, item := range []struct {
Value interface{}