Add test for stray empty quotes in @sh

This commit is contained in:
Vit Zikmund 2023-02-07 09:06:00 +00:00
parent 8ebc0e5801
commit 9f0cf4987f

View File

@ -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.",