diff --git a/cts.json b/cts.json index a7b7ae2..c2a9134 100644 --- a/cts.json +++ b/cts.json @@ -477,6 +477,112 @@ ] ] }, + { + "name": "basic, descendant segment, wildcard selector, nested objects", + "selector": "$..[*]", + "document": { + "a": { + "c": { + "e": 1 + } + }, + "b": { + "d": 2 + } + }, + "results": [ + [ + { + "c": { + "e": 1 + } + }, + { + "d": 2 + }, + { + "e": 1 + }, + 1, + 2 + ], + [ + { + "c": { + "e": 1 + } + }, + { + "d": 2 + }, + { + "e": 1 + }, + 2, + 1 + ], + [ + { + "c": { + "e": 1 + } + }, + { + "d": 2 + }, + 2, + { + "e": 1 + }, + 1 + ], + [ + { + "d": 2 + }, + { + "c": { + "e": 1 + } + }, + { + "e": 1 + }, + 1, + 2 + ], + [ + { + "d": 2 + }, + { + "c": { + "e": 1 + } + }, + { + "e": 1 + }, + 2, + 1 + ], + [ + { + "d": 2 + }, + { + "c": { + "e": 1 + } + }, + 2, + { + "e": 1 + }, + 1 + ] + ] + }, { "name": "basic, descendant segment, wildcard shorthand, object data", "selector": "$..*", diff --git a/tests/basic.json b/tests/basic.json index 2fb2340..eb30e40 100644 --- a/tests/basic.json +++ b/tests/basic.json @@ -409,6 +409,19 @@ [[[1]],[2],[1],2,1] ] }, + { + "name": "descendant segment, wildcard selector, nested objects", + "selector" : "$..[*]", + "document" : {"a": {"c": {"e": 1}}, "b": {"d": 2}}, + "results": [ + [{"c": {"e": 1}}, {"d": 2}, {"e": 1}, 1, 2], + [{"c": {"e": 1}}, {"d": 2}, {"e": 1}, 2, 1], + [{"c": {"e": 1}}, {"d": 2}, 2, {"e": 1}, 1], + [{"d": 2}, {"c": {"e": 1}}, {"e": 1}, 1, 2], + [{"d": 2}, {"c": {"e": 1}}, {"e": 1}, 2, 1], + [{"d": 2}, {"c": {"e": 1}}, 2, {"e": 1}, 1] + ] + }, { "name": "descendant segment, wildcard shorthand, object data", "selector" : "$..*",