mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-04 00:49:46 +00:00
45 lines
980 B
Go
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)
|
||
|
}
|
||
|
}
|