diff --git a/toml_test.go b/toml_test.go index ce3cf1c..45279a3 100644 --- a/toml_test.go +++ b/toml_test.go @@ -44,6 +44,7 @@ func TestTomlGetArray(t *testing.T) { tree, _ := Load(` [test] key = ["one", "two"] + key2 = [true, false, false] `) if tree.GetArray("") != tree { @@ -56,6 +57,12 @@ func TestTomlGetArray(t *testing.T) { t.Errorf("GetArray should return the []string value") } + expect2 := []bool{true, false, false} + actual2 := tree.GetArray("test.key2").([]bool) + if !reflect.DeepEqual(actual2, expect2) { + t.Errorf("GetArray should return the []string value") + } + if tree.GetArray(`\`) != nil { t.Errorf("should return nil when the key is malformed") }