Added properties round trip test

This commit is contained in:
Mike Farah
2022-02-09 13:31:51 +11:00
parent a5ab9a8a0a
commit e0d6b45651
6 changed files with 100 additions and 6 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
#!/bin/bash
setUp() {
rm test*.yml || true
rm .xyz -f || true
rm test*.yml 2>/dev/null || true
rm .xyz 2>/dev/null || true
}
testBasicEvalRoundTrip() {
+20 -1
View File
@@ -1,7 +1,26 @@
#!/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"
}
testInputXml() {