mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-03 02:51:40 +00:00
Add tests for accessing !!str <<
This commit is contained in:
parent
ae87394f4a
commit
3431aebb2c
@ -438,6 +438,15 @@ var anchorOperatorScenarios = []expressionScenario{
|
|||||||
"D0, P[], (!!map)::{a: 1, a: 2}\n",
|
"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) {
|
func TestAnchorAliasOperatorScenarios(t *testing.T) {
|
||||||
|
|||||||
@ -631,6 +631,15 @@ var traversePathOperatorScenarios = []expressionScenario{
|
|||||||
"D0, P[<<], (!!int)::37\n",
|
"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) {
|
func TestTraversePathOperatorScenarios(t *testing.T) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user