Skip to content

Commit

Permalink
Merge pull request #68 from glyn/object-non-determinism
Browse files Browse the repository at this point in the history
Add a nested object case with non-determinism
  • Loading branch information
glyn authored Mar 21, 2024
2 parents d012356 + c4dc7d8 commit 7bd8532
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 0 deletions.
106 changes: 106 additions & 0 deletions cts.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "$..*",
Expand Down
13 changes: 13 additions & 0 deletions tests/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : "$..*",
Expand Down

0 comments on commit 7bd8532

Please sign in to comment.