diff --git a/pkg/yqlib/operator_encoder_decoder_test.go b/pkg/yqlib/operator_encoder_decoder_test.go index 6db682ec..13448adf 100644 --- a/pkg/yqlib/operator_encoder_decoder_test.go +++ b/pkg/yqlib/operator_encoder_decoder_test.go @@ -266,6 +266,16 @@ var encoderDecoderOperatorScenarios = []expressionScenario{ "D0, P[coolData], (!!str)::strings' with spaces and a '\\'quote\\'\n", }, }, + { + description: "Encode a string to sh", + subdescription: "Watch out for stray '' (empty strings)", + document: "coolData: \"'starts, contains more '' and ends with a quote'\"", + expression: ".coolData | @sh", + expected: []string{ + "D0, P[coolData], (!!str)::\\'starts,' contains more '\\'\\'' and ends with a quote'\\'\n", + }, + skipDoc: true, + }, { description: "Decode a base64 encoded string", subdescription: "Decoded data is assumed to be a string.",