From 7ade7a97a5cf4a1b9c2f587900d97bedb5fda1e0 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Thu, 23 Feb 2023 16:32:06 +1100 Subject: [PATCH] Variable loop wip --- pkg/yqlib/operator_variables_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/yqlib/operator_variables_test.go b/pkg/yqlib/operator_variables_test.go index ce01b563..64643ab0 100644 --- a/pkg/yqlib/operator_variables_test.go +++ b/pkg/yqlib/operator_variables_test.go @@ -44,6 +44,14 @@ var variableOperatorScenarios = []expressionScenario{ "D0, P[1], (!!int)::2\n", }, }, + { + skipDoc: true, + document: `[1, 2]`, + expression: `[.[] | . as $f | $f + 1]`, + expected: []string{ + "D0, P[], (!!seq)::- 2\n- 3\n", + }, + }, { description: "Using variables as a lookup", subdescription: "Example taken from [jq](https://stedolan.github.io/jq/manual/#Variable/SymbolicBindingOperator:...as$identifier|...)",