From 54f5c9ee2fb42191468244e152de600c6c8e5d67 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Mon, 3 Apr 2023 17:29:33 +1000 Subject: [PATCH] wip --- pkg/yqlib/properties_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pkg/yqlib/properties_test.go b/pkg/yqlib/properties_test.go index dcae4121..bf67d043 100644 --- a/pkg/yqlib/properties_test.go +++ b/pkg/yqlib/properties_test.go @@ -147,6 +147,32 @@ var propertyScenarios = []formatScenario{ expected: expectedDecodedYaml, scenarioType: "decode", }, + + { + skipDoc: true, + description: "Decode properties - keeps key information", + input: expectedPropertiesUnwrapped, + expression: ".person.name | key", + expected: "name", + scenarioType: "decode", + }, + { + skipDoc: true, + description: "Decode properties - keeps parent information", + input: expectedPropertiesUnwrapped, + expression: ".person.name | parent", + expected: "name", + scenarioType: "decode", + }, + { + skipDoc: true, + description: "Decode properties - keeps path information", + input: expectedPropertiesUnwrapped, + expression: ".person.name | path", + expected: "name", + scenarioType: "decode", + }, + { description: "Decode properties - array should be a map", subdescription: "If you have a numeric map key in your property files, use array_to_map to convert them to maps.",