yq/pkg/yqlib/goccy_yaml_test.go
2023-10-05 17:53:42 +11:00

45 lines
980 B
Go

package yqlib
import (
"testing"
"github.com/mikefarah/yq/v4/test"
)
var goccyYamlFormatScenarios = []formatScenario{
// {
// description: "basic - 3",
// skipDoc: true,
// input: "3",
// expected: "3\n",
// },
// {
// description: "basic - 3.1",
// skipDoc: true,
// input: "3.1",
// expected: "3.1\n",
// },
// {
// description: "basic - 3.1",
// skipDoc: true,
// input: "mike: 3",
// expected: "mike: 3\n",
// },
{
description: "basic - 3.1",
skipDoc: true,
input: "mike: !!cat 3",
expected: "mike: !!cat 3\n",
},
}
func testGoccyYamlScenario(t *testing.T, s formatScenario) {
test.AssertResultWithContext(t, s.expected, mustProcessFormatScenario(s, NewGoccyYAMLDecoder(), NewYamlEncoder(2, false, ConfiguredYamlPreferences)), s.description)
}
func TestGoccyYmlFormatScenarios(t *testing.T) {
for _, tt := range goccyYamlFormatScenarios {
testGoccyYamlScenario(t, tt)
}
}