Adding failing test for comments losing their position when in between xml nodes.

This commit is contained in:
Lilith 2022-12-14 16:14:28 -08:00
parent f6a48b6899
commit c3691f2185
No known key found for this signature in database
GPG Key ID: A6B0120983B026EC

View File

@ -259,6 +259,11 @@ var xmlScenarios = []formatScenario{
input: "<root>value<!-- comment-->anotherValue </root>", input: "<root>value<!-- comment-->anotherValue </root>",
expected: "root:\n # comment\n - value\n - anotherValue\n", expected: "root:\n # comment\n - value\n - anotherValue\n",
}, },
{
skipDoc: true,
input: "<root><cats><cat>quick</cat><cat>soft</cat><!-- kitty_comment--><cat>squishy</cat></cats></root>",
expected: "root:\n cats:\n cat:\n - quick\n - soft\n # kitty_comment\n - squishy\n",
},
{ {
description: "Parse xml: simple", description: "Parse xml: simple",
subdescription: "Notice how all the values are strings, see the next example on how you can fix that.", subdescription: "Notice how all the values are strings, see the next example on how you can fix that.",