From 09c5ed24be717c27aa875af9fe7c1cc2514a7838 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Thu, 10 Jun 2021 08:35:41 +1000 Subject: [PATCH] Updating docs --- pkg/yqlib/doc/Traverse (Read).md | 7 +++---- pkg/yqlib/doc/headers/Traverse (Read).md | 2 +- pkg/yqlib/operator_traverse_path_test.go | 9 +++++---- 3 files changed, 9 insertions(+), 9 deletions(-) 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", },