diff --git a/pkg/yqlib/operator_traverse_path_test.go b/pkg/yqlib/operator_traverse_path_test.go index 58ae6263..65ec97f9 100644 --- a/pkg/yqlib/operator_traverse_path_test.go +++ b/pkg/yqlib/operator_traverse_path_test.go @@ -612,6 +612,25 @@ var traversePathOperatorScenarios = []expressionScenario{ "D0, P[a], (!!int)::2\n", }, }, + { + skipDoc: true, + description: "Traversing map with invalid merge anchor should not fail", + subdescription: "Otherwise code cannot do anything with it", + document: `{a: 42, <<: 37}`, + expression: `.a`, + expected: []string{ + "D0, P[a], (!!int)::42\n", + }, + }, + { + skipDoc: true, + description: "Directly accessing invalid merge anchor should not fail", + document: `{<<: 37}`, + expression: `.<<`, + expected: []string{ + "D0, P[<<], (!!int)::37\n", + }, + }, } func TestTraversePathOperatorScenarios(t *testing.T) {