diff options
Diffstat (limited to 'tpl/transform/remarshal_test.go')
-rw-r--r-- | tpl/transform/remarshal_test.go | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/tpl/transform/remarshal_test.go b/tpl/transform/remarshal_test.go index 1416afff3..07414ccb4 100644 --- a/tpl/transform/remarshal_test.go +++ b/tpl/transform/remarshal_test.go @@ -18,7 +18,6 @@ import ( "testing" "github.com/gohugoio/hugo/helpers" - "github.com/gohugoio/hugo/parser/metadecoders" "github.com/spf13/viper" "github.com/stretchr/testify/require" ) @@ -171,34 +170,3 @@ func TestTestRemarshalError(t *testing.T) { assert.Error(err) } - -func TestRemarshalDetectFormat(t *testing.T) { - t.Parallel() - assert := require.New(t) - - for i, test := range []struct { - data string - expect interface{} - }{ - {`foo = "bar"`, metadecoders.TOML}, - {` foo = "bar"`, metadecoders.TOML}, - {`foo="bar"`, metadecoders.TOML}, - {`foo: "bar"`, metadecoders.YAML}, - {`foo:"bar"`, metadecoders.YAML}, - {`{ "foo": "bar"`, metadecoders.JSON}, - {`asdfasdf`, false}, - {``, false}, - } { - errMsg := fmt.Sprintf("[%d] %s", i, test.data) - - result, err := detectFormat(test.data) - - if b, ok := test.expect.(bool); ok && !b { - assert.Error(err, errMsg) - continue - } - - assert.NoError(err, errMsg) - assert.Equal(test.expect, result) - } -} |