diff --git a/pkg/yqlib/operator_anchors_aliases_test.go b/pkg/yqlib/operator_anchors_aliases_test.go index 988af027..d66522c2 100644 --- a/pkg/yqlib/operator_anchors_aliases_test.go +++ b/pkg/yqlib/operator_anchors_aliases_test.go @@ -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) { diff --git a/pkg/yqlib/operator_traverse_path_test.go b/pkg/yqlib/operator_traverse_path_test.go index 65ec97f9..0b29376c 100644 --- a/pkg/yqlib/operator_traverse_path_test.go +++ b/pkg/yqlib/operator_traverse_path_test.go @@ -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) {