mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 13:48:06 +00:00
25 lines
343 B
Bash
25 lines
343 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
setUp() {
|
||
|
rm test*.yml || true
|
||
|
}
|
||
|
|
||
|
testInputXml() {
|
||
|
cat >test.yml <<EOL
|
||
|
<cat legs="4">BiBi</cat>
|
||
|
EOL
|
||
|
|
||
|
read -r -d '' expected << EOM
|
||
|
cat:
|
||
|
+content: BiBi
|
||
|
+legs: "4"
|
||
|
EOM
|
||
|
|
||
|
X=$(./yq e -p=xml test.yml)
|
||
|
assertEquals "$expected" "$X"
|
||
|
|
||
|
X=$(./yq ea -p=xml test.yml)
|
||
|
assertEquals "$expected" "$X"
|
||
|
}
|
||
|
|
||
|
source ./scripts/shunit2
|