Added XML encoding/decoding

This commit is contained in:
Mike Farah
2022-01-15 11:44:52 +11:00
parent 606ef91cc6
commit be36a0ef4b
29 changed files with 1008 additions and 350 deletions
+21
View File
@@ -142,4 +142,25 @@ EOM
assertEquals "$expected" "$X"
}
testOutputXmComplex() {
cat >test.yml <<EOL
a: {b: {c: ["cat", "dog"], +f: meow}}
EOL
read -r -d '' expected << EOM
<a>
<b f="meow">
<c>cat</c>
<c>dog</c>
</b>
</a>
EOM
X=$(./yq e --output-format=x test.yml)
assertEquals "$expected" "$X"
X=$(./yq ea --output-format=x test.yml)
assertEquals "$expected" "$X"
}
source ./scripts/shunit2