Fix marshaling nested arrays of tables (#395)

Fixes #369
This commit is contained in:
x-hgg-x
2020-05-07 14:09:23 +02:00
committed by GitHub
parent 249d0eaf46
commit 96ff402934
5 changed files with 99 additions and 59 deletions
+2 -2
View File
@@ -919,10 +919,10 @@ func TestTomlValueStringRepresentation(t *testing.T) {
{"\b\t\n\f\r\"\\", "\"\\b\\t\\n\\f\\r\\\"\\\\\""},
{"\x05", "\"\\u0005\""},
{time.Date(1979, time.May, 27, 7, 32, 0, 0, time.UTC), "1979-05-27T07:32:00Z"},
{[]interface{}{"gamma", "delta"}, "[\"gamma\",\"delta\"]"},
{[]interface{}{"gamma", "delta"}, "[\"gamma\", \"delta\"]"},
{nil, ""},
} {
result, err := tomlValueStringRepresentation(item.Value, "", "", OrderPreserve, false)
result, err := tomlValueStringRepresentation(item.Value, "", "", OrderAlphabetical, false)
if err != nil {
t.Errorf("Test %d - unexpected error: %s", idx, err)
}