Clarify use of brackets when reading with special characters

This commit is contained in:
neuroevolutus 2023-03-12 14:16:25 -05:00
parent d26dad7117
commit 0e3787032c
2 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ will output
``` ```
## Special characters ## Special characters
Use quotes with brackets around path elements with special characters Use quotes with square brackets around path elements with special characters
Given a sample.yml file of: Given a sample.yml file of:
```yaml ```yaml
@ -83,7 +83,7 @@ apple
``` ```
## Keys with spaces ## Keys with spaces
Use quotes with brackets around path elements with special characters Use quotes with square brackets around path elements with special characters
Given a sample.yml file of: Given a sample.yml file of:
```yaml ```yaml

View File

@ -116,7 +116,7 @@ var traversePathOperatorScenarios = []expressionScenario{
}, },
{ {
description: "Special characters", description: "Special characters",
subdescription: "Use quotes with brackets around path elements with special characters", subdescription: "Use quotes with square brackets around path elements with special characters",
document: `{"{}": frog}`, document: `{"{}": frog}`,
expression: `.["{}"]`, expression: `.["{}"]`,
expected: []string{ expected: []string{
@ -133,7 +133,7 @@ var traversePathOperatorScenarios = []expressionScenario{
}, },
{ {
description: "Keys with spaces", description: "Keys with spaces",
subdescription: "Use quotes with brackets around path elements with special characters", subdescription: "Use quotes with square brackets around path elements with special characters",
document: `{"red rabbit": frog}`, document: `{"red rabbit": frog}`,
expression: `.["red rabbit"]`, expression: `.["red rabbit"]`,
expected: []string{ expected: []string{