Array values

This commit is contained in:
Thomas Pelletier
2021-02-08 20:38:53 -05:00
parent 0e8fd64203
commit 3488a91eff
2 changed files with 19 additions and 1 deletions
+10
View File
@@ -234,3 +234,13 @@ Name = "plantain"
assert.Equal(t, expected, x)
}
func TestArraySimple(t *testing.T) {
x := struct {
Foo []string
}{}
doc := `Foo = ["hello", "world"]`
err := toml.Unmarshal([]byte(doc), &x)
require.NoError(t, err)
assert.Equal(t, []string{"hello", "world"}, x.Foo)
}