Added github action fix for parsing xml

This commit is contained in:
Mike Farah
2022-02-07 11:26:48 +11:00
parent 2891c6948d
commit 06e944dcb6
3 changed files with 53 additions and 1 deletions
+30 -1
View File
@@ -4,6 +4,7 @@ import (
"bufio"
"bytes"
"fmt"
"io"
"strings"
"testing"
@@ -18,7 +19,7 @@ func decodeXml(t *testing.T, s formatScenario) *CandidateNode {
node := &yaml.Node{}
err := decoder.Decode(node)
if err != nil {
if err != nil && err != io.EOF {
t.Error(err, "fail to decode", s.input)
}
@@ -266,6 +267,34 @@ var xmlScenarios = []formatScenario{
expected: expectedDecodeYamlWithComments,
scenarioType: "decode",
},
{
description: "Empty doc",
skipDoc: true,
input: "",
expected: "D0, P[], ()::null\n",
scenarioType: "decode",
},
{
description: "Empty single node",
skipDoc: true,
input: "<a/>",
expected: "D0, P[], (doc)::a:\n",
scenarioType: "decode",
},
{
description: "Empty close node",
skipDoc: true,
input: "<a></a>",
expected: "D0, P[], (doc)::a:\n",
scenarioType: "decode",
},
{
description: "Nested empty",
skipDoc: true,
input: "<a><b/></a>",
expected: "D0, P[], (doc)::a:\n b:\n",
scenarioType: "decode",
},
{
description: "Parse xml: with comments subchild",
skipDoc: true,