diff --git a/pkg/yqlib/doc/Traverse (Read).md b/pkg/yqlib/doc/Traverse (Read).md index 56dca175..eca29e0e 100644 --- a/pkg/yqlib/doc/Traverse (Read).md +++ b/pkg/yqlib/doc/Traverse (Read).md @@ -1,4 +1,4 @@ -This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structurse. +This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structures. ## Simple map navigation Given a sample.yml file of: ```yaml @@ -63,7 +63,7 @@ will output frog ``` -## Multiple special characters +## Nested special characters Given a sample.yml file of: ```yaml a: @@ -230,8 +230,7 @@ will output ## Traversing nested arrays by index Given a sample.yml file of: ```yaml -- [] -- - cat +[[], [cat]] ``` then ```bash diff --git a/pkg/yqlib/doc/headers/Traverse (Read).md b/pkg/yqlib/doc/headers/Traverse (Read).md index d69c3078..8420cada 100644 --- a/pkg/yqlib/doc/headers/Traverse (Read).md +++ b/pkg/yqlib/doc/headers/Traverse (Read).md @@ -1 +1 @@ -This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structurse. \ No newline at end of file +This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structures. \ No newline at end of file diff --git a/pkg/yqlib/operator_traverse_path_test.go b/pkg/yqlib/operator_traverse_path_test.go index cafc7398..dd917fd4 100644 --- a/pkg/yqlib/operator_traverse_path_test.go +++ b/pkg/yqlib/operator_traverse_path_test.go @@ -78,7 +78,7 @@ var traversePathOperatorScenarios = []expressionScenario{ }, }, { - description: "Multiple special characters", + description: "Nested special characters", document: `a: {"key.withdots": {"another.key": apple}}`, expression: `.a["key.withdots"]["another.key"]`, expected: []string{ @@ -253,9 +253,10 @@ var traversePathOperatorScenarios = []expressionScenario{ }, }, { - description: "Traversing nested arrays by index", - document: `[[], [cat]]`, - expression: `.[1][0]`, + description: "Traversing nested arrays by index", + dontFormatInputForDoc: true, + document: `[[], [cat]]`, + expression: `.[1][0]`, expected: []string{ "D0, P[1 0], (!!str)::cat\n", },