Draft: Toml (#1439)

* toml wip

* wip

* Fixed auto parsing toml

* Added build flag not to include toml

* Parse toml docs and tests

* minor updates
This commit is contained in:
Mike Farah
2023-03-26 10:59:15 +11:00
committed by GitHub
parent 47f4ddc910
commit 7103b78d38
16 changed files with 828 additions and 23 deletions
+21
View File
@@ -2,6 +2,7 @@
setUp() {
rm test*.yml 2>/dev/null || true
rm test*.toml 2>/dev/null || true
rm test*.tfstate 2>/dev/null || true
rm test*.json 2>/dev/null || true
rm test*.properties 2>/dev/null || true
@@ -30,6 +31,26 @@ EOM
assertEquals "$expected" "$X"
}
testInputToml() {
cat >test.toml <<EOL
[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00
EOL
read -r -d '' expected << EOM
owner:
name: Tom Preston-Werner
dob: 1979-05-27T07:32:00-08:00
EOM
X=$(./yq -oy test.toml)
assertEquals "$expected" "$X"
X=$(./yq ea -oy test.toml)
assertEquals "$expected" "$X"
}
testInputTfstate() {
cat >test.tfstate <<EOL
{ "mike" : { "things": "cool" } }