diff --git a/pkg/yqlib/operator_collect_object_test.go b/pkg/yqlib/operator_collect_object_test.go index fcc399d0..edbe63d2 100644 --- a/pkg/yqlib/operator_collect_object_test.go +++ b/pkg/yqlib/operator_collect_object_test.go @@ -116,9 +116,11 @@ var collectObjectOperatorScenarios = []expressionScenario{ { skipDoc: true, document: `{name: Mike, pets: {cows: [apl, bba]}}`, + document2: `{name: Rosey, pets: {sheep: [frog, meow]}}`, expression: `{"a":.name, "b":.pets}`, expected: []string{ "D0, P[], (!!map)::a: Mike\nb: {cows: [apl, bba]}\n", + "D0, P[], (!!map)::a: Rosey\nb: {sheep: [frog, meow]}\n", }, }, { @@ -129,6 +131,13 @@ var collectObjectOperatorScenarios = []expressionScenario{ "D0, P[], (!!map)::wrap: frog\n", }, }, + { + skipDoc: true, + expression: `{"wrap": "frog", "bing": "bong"}`, + expected: []string{ + "D0, P[], (!!map)::wrap: frog\nbing: bong\n", + }, + }, { skipDoc: true, document: `{name: Mike}`,