Added XML encoding/decoding (#1067)

* Added XML encoding/decoding

* Minor fixes

* Improve yq doc

* Lint
This commit is contained in:
Mike Farah
2022-01-15 11:57:59 +11:00
committed by GitHub
parent 606ef91cc6
commit ec8ef312ef
30 changed files with 1005 additions and 351 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