Decoder Properties (#1099)

* Decoder Properties

* Added properties round trip test

* Fixed property decode for github actions

* Refactored XML test to use common functions

* Switched formatScenario parameter order for more readablity
This commit is contained in:
Mike Farah
2022-02-10 12:02:53 +11:00
committed by GitHub
parent 4d4bd5114d
commit a9c3617b4f
14 changed files with 464 additions and 191 deletions
+37 -1
View File
@@ -1,7 +1,43 @@
#!/bin/bash
setUp() {
rm test*.yml || true
rm test*.yml 2>/dev/null || true
rm test*.properties 2>/dev/null || true
rm test*.xml 2>/dev/null || true
}
testInputProperties() {
cat >test.properties <<EOL
mike.things = hello
EOL
read -r -d '' expected << EOM
mike:
things: hello
EOM
X=$(./yq e -p=props test.properties)
assertEquals "$expected" "$X"
X=$(./yq ea -p=props test.properties)
assertEquals "$expected" "$X"
}
testInputPropertiesGitHubAction() {
cat >test.properties <<EOL
mike.things = hello
EOL
read -r -d '' expected << EOM
mike:
things: hello
EOM
X=$(cat /dev/null | ./yq e -p=props test.properties)
assertEquals "$expected" "$X"
X=$(cat /dev/null | ./yq ea -p=props test.properties)
assertEquals "$expected" "$X"
}
testInputXml() {