Add CSV support to transform.Unmarshal

Fixes #5555
This commit is contained in:
Bjørn Erik Pedersen 2018-12-23 10:40:32 +01:00
parent 822dc627a1
commit a574469797
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
16 changed files with 238 additions and 44 deletions

View file

@ -88,12 +88,13 @@ func TestFormatFromContentString(t *testing.T) {
{`foo: "bar"`, YAML},
{`foo:"bar"`, YAML},
{`{ "foo": "bar"`, JSON},
{`a,b,c"`, CSV},
{`asdfasdf`, Format("")},
{``, Format("")},
} {
errMsg := fmt.Sprintf("[%d] %s", i, test.data)
result := FormatFromContentString(test.data)
result := Default.FormatFromContentString(test.data)
assert.Equal(test.expect, result, errMsg)
}