diff --git a/pkg/yqlib/yaml_test.go b/pkg/yqlib/yaml_test.go index 6306dc77..f099f95c 100644 --- a/pkg/yqlib/yaml_test.go +++ b/pkg/yqlib/yaml_test.go @@ -19,6 +19,12 @@ var yamlFormatScenarios = []formatScenario{ input: "~", expected: "~\n", }, + { + description: "comment", + skipDoc: true, + input: "# cat", + expected: "# cat\n", + }, { description: "octal", skipDoc: true, @@ -100,7 +106,7 @@ var yamlParseScenarios = []expressionScenario{ } func testYamlScenario(t *testing.T, s formatScenario) { - test.AssertResultWithContext(t, s.expected, mustProcessFormatScenario(s, NewYamlDecoder(NewDefaultYamlPreferences()), NewYamlEncoder(2, false, ConfiguredYamlPreferences)), s.description) + test.AssertResultWithContext(t, s.expected, mustProcessFormatScenario(s, NewYamlDecoder(ConfiguredYamlPreferences), NewYamlEncoder(2, false, ConfiguredYamlPreferences)), s.description) } func TestYamlParseScenarios(t *testing.T) {