From 732a1e33d59aaed488826717de5603643e5d8fc5 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Fri, 24 Mar 2023 17:03:18 +1100 Subject: [PATCH] Parse toml docs and tests --- .gitignore | 2 + acceptance_tests/inputs-format-auto.sh | 21 +++++ cmd/utils.go | 3 + pkg/yqlib/doc/usage/headers/toml.md | 4 + pkg/yqlib/doc/usage/toml.md | 111 +++++++++++++++++++++++++ pkg/yqlib/toml_test.go | 62 +++++++++++--- 6 files changed, 191 insertions(+), 12 deletions(-) create mode 100644 pkg/yqlib/doc/usage/headers/toml.md create mode 100644 pkg/yqlib/doc/usage/toml.md diff --git a/.gitignore b/.gitignore index b159f65d..aef9fba2 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,8 @@ yq*.snap test.yml test*.yml +test*.xml +test*.toml test*.yaml 0.yml 1.yml diff --git a/acceptance_tests/inputs-format-auto.sh b/acceptance_tests/inputs-format-auto.sh index a5e6897c..3c241d65 100755 --- a/acceptance_tests/inputs-format-auto.sh +++ b/acceptance_tests/inputs-format-auto.sh @@ -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 <test.tfstate <