Add tests for accessing !!str <<

This commit is contained in:
Steven WdV 2025-07-20 13:28:14 +02:00
parent ae87394f4a
commit 3431aebb2c
No known key found for this signature in database
2 changed files with 18 additions and 0 deletions

View File

@ -438,6 +438,15 @@ var anchorOperatorScenarios = []expressionScenario{
"D0, P[], (!!map)::{a: 1, a: 2}\n",
},
},
{
skipDoc: true,
description: "!!str << should not be treated as merge anchor",
document: `{!!str <<: {a: 37}}`,
expression: `explode(.).a`,
expected: []string{
"D0, P[a], (!!null)::null\n",
},
},
}
func TestAnchorAliasOperatorScenarios(t *testing.T) {

View File

@ -631,6 +631,15 @@ var traversePathOperatorScenarios = []expressionScenario{
"D0, P[<<], (!!int)::37\n",
},
},
{
skipDoc: true,
description: "!!str << should not be treated as merge anchor",
document: `{!!str <<: {a: 37}}`,
expression: `.a`,
expected: []string{
"D0, P[a], (!!null)::null\n",
},
},
}
func TestTraversePathOperatorScenarios(t *testing.T) {