From a25f636a07375c5a04b276d33cf6937ed3916716 Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Tue, 23 Mar 2021 21:18:19 -0400 Subject: [PATCH] Add array support todo --- README.md | 3 ++- internal/imported_tests/unmarshal_imported_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index efcb64b..cfc08dc 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,9 @@ Development branch. Probably does not work. - [x] Support Array Tables. - [x] Unmarshal into pointers. - [x] Support Date / times. -- [ ] Support Unmarshaler interface. - [x] Support struct tags annotations. +- [ ] Support Arrays. +- [ ] Support Unmarshaler interface. - [ ] Original go-toml unmarshal tests pass. - [ ] Benchmark! - [ ] Abstract AST. diff --git a/internal/imported_tests/unmarshal_imported_test.go b/internal/imported_tests/unmarshal_imported_test.go index f450d50..0e06d0c 100644 --- a/internal/imported_tests/unmarshal_imported_test.go +++ b/internal/imported_tests/unmarshal_imported_test.go @@ -1833,7 +1833,7 @@ func TestUnmarshalSliceFail2(t *testing.T) { assert.Error(t, toml.Unmarshal([]byte(doc), &actual)) } -func TestUnmarshalMixedTypeArray(t *testing.T) { +func TestUnmarshalMixedTypeSlice(t *testing.T) { type TestStruct struct { ArrayField []interface{} } @@ -1854,9 +1854,9 @@ func TestUnmarshalMixedTypeArray(t *testing.T) { map[string]interface{}{ "Field": "inner1", }, - []map[string]interface{}{ - {"Field": "inner2"}, - {"Field": "inner3"}, + []interface{}{ + map[string]interface{}{"Field": "inner2"}, + map[string]interface{}{"Field": "inner3"}, }, }, }