From 1d35134310026db76bf85cf4f3714d61d065997d Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Thu, 10 Nov 2022 19:21:18 +1100 Subject: [PATCH] Unwrap scalar now works for JSON encoding when explicitly set #1409 --- acceptance_tests/output-format.sh | 76 +++++++++++++++++++++++++-- cmd/constant.go | 49 ++++++++++++++++- cmd/root.go | 12 ++++- cmd/utils.go | 2 +- go.mod | 2 +- pkg/yqlib/encoder_json.go | 9 +++- pkg/yqlib/encoder_test.go | 2 +- pkg/yqlib/json_test.go | 10 ++-- pkg/yqlib/operator_encoder_decoder.go | 2 +- pkg/yqlib/printer_test.go | 2 +- 10 files changed, 147 insertions(+), 19 deletions(-) diff --git a/acceptance_tests/output-format.sh b/acceptance_tests/output-format.sh index a238dc0b..400668db 100755 --- a/acceptance_tests/output-format.sh +++ b/acceptance_tests/output-format.sh @@ -48,6 +48,55 @@ EOM assertEquals "$expected" "$X" } +testOutputYamlRawDefault() { + cat >test.yml <test.yml <test.yml <test.yml <test.yml <test.yml <test.yml <test.yml <