more docs

This commit is contained in:
Mike Farah 2020-11-15 10:58:47 +11:00
parent af2aa9ad91
commit b3efcdc202

View File

@ -6,6 +6,7 @@ import (
var recursiveDescentOperatorScenarios = []expressionScenario{
{
skipDoc: true,
document: `cat`,
expression: `..`,
expected: []string{
@ -13,6 +14,7 @@ var recursiveDescentOperatorScenarios = []expressionScenario{
},
},
{
skipDoc: true,
document: `{a: frog}`,
expression: `..`,
expected: []string{
@ -21,6 +23,7 @@ var recursiveDescentOperatorScenarios = []expressionScenario{
},
},
{
description: "Map",
document: `{a: {b: apple}}`,
expression: `..`,
expected: []string{
@ -30,6 +33,7 @@ var recursiveDescentOperatorScenarios = []expressionScenario{
},
},
{
description: "Array",
document: `[1,2,3]`,
expression: `..`,
expected: []string{
@ -40,6 +44,7 @@ var recursiveDescentOperatorScenarios = []expressionScenario{
},
},
{
description: "Array of maps",
document: `[{a: cat},2,true]`,
expression: `..`,
expected: []string{
@ -51,6 +56,7 @@ var recursiveDescentOperatorScenarios = []expressionScenario{
},
},
{
description: "Aliases are not traversed",
document: `{a: &cat {c: frog}, b: *cat}`,
expression: `..`,
expected: []string{
@ -61,6 +67,7 @@ var recursiveDescentOperatorScenarios = []expressionScenario{
},
},
{
description: "Merge docs are not traversed",
document: mergeDocSample,
expression: `.foobar | ..`,
expected: []string{
@ -71,6 +78,7 @@ var recursiveDescentOperatorScenarios = []expressionScenario{
},
},
{
skipDoc: true,
document: mergeDocSample,
expression: `.foobarList | ..`,
expected: []string{
@ -88,4 +96,5 @@ func TestRecursiveDescentOperatorScenarios(t *testing.T) {
for _, tt := range recursiveDescentOperatorScenarios {
testScenario(t, &tt)
}
documentScenarios(t, "Recursive Descent Operator", recursiveDescentOperatorScenarios)
}