mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-01 14:14:52 +08:00
Length (and some other operators) should not include head/foot comments #1231
This commit is contained in:
@@ -150,6 +150,16 @@ var envOperatorScenarios = []expressionScenario{
|
||||
expression: `"the ${notThere} ${alsoNotThere}" | envsubst(nu,ff)`,
|
||||
expectedError: "variable ${notThere} not set",
|
||||
},
|
||||
{
|
||||
description: "with header/footer",
|
||||
skipDoc: true,
|
||||
environmentVariables: map[string]string{"myenv": "cat meow"},
|
||||
document: "# abc\n{v: \"${myenv}\"}\n# xyz\n",
|
||||
expression: `(.. | select(tag == "!!str")) |= envsubst`,
|
||||
expected: []string{
|
||||
"D0, P[], (!!map)::# abc\n{v: \"cat meow\"}\n# xyz\n",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func TestEnvOperatorScenarios(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user