From 54b355bffb3869b04c1040746b0cfcf54274c224 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Wed, 1 Dec 2021 09:14:18 +1100 Subject: [PATCH] Added another test --- pkg/yqlib/operator_collect_object_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) 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}`,