From 855b3c4b47fa811cfed65bee3de998947cc17d55 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Thu, 2 Dec 2021 12:29:23 +1100 Subject: [PATCH] Cleanup test --- pkg/yqlib/doc/encode-decode.md | 20 -------------------- pkg/yqlib/operator_encoder_decoder_test.go | 7 +++---- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/pkg/yqlib/doc/encode-decode.md b/pkg/yqlib/doc/encode-decode.md index f4640496..d4416608 100644 --- a/pkg/yqlib/doc/encode-decode.md +++ b/pkg/yqlib/doc/encode-decode.md @@ -157,26 +157,6 @@ b: | bob: dylan ``` -## Encode value as yaml string, using toyaml -Does the same thing as to_yaml, matching jq naming convention. - -Given a sample.yml file of: -```yaml -a: - cool: thing -``` -then -```bash -yq eval '.b = (.a | to_yaml)' sample.yml -``` -will output -```yaml -a: - cool: thing -b: | - cool: thing -``` - ## Decode a yaml encoded string Given a sample.yml file of: ```yaml diff --git a/pkg/yqlib/operator_encoder_decoder_test.go b/pkg/yqlib/operator_encoder_decoder_test.go index 60726e1a..c7597533 100644 --- a/pkg/yqlib/operator_encoder_decoder_test.go +++ b/pkg/yqlib/operator_encoder_decoder_test.go @@ -90,10 +90,9 @@ var encoderDecoderOperatorScenarios = []expressionScenario{ }, }, { - description: "Encode value as yaml string, using toyaml", - subdescription: "Does the same thing as to_yaml, matching jq naming convention.", - document: `{a: {cool: "thing"}}`, - expression: `.b = (.a | to_yaml)`, + skipDoc: true, + document: `{a: {cool: "thing"}}`, + expression: `.b = (.a | to_yaml)`, expected: []string{ `D0, P[], (doc)::{a: {cool: "thing"}, b: "{cool: \"thing\"}\n"} `,