Skip to content

Commit

Permalink
Introduce some tests of non-determinism
Browse files Browse the repository at this point in the history
Ref #9
  • Loading branch information
glyn committed Feb 29, 2024
1 parent 446336c commit 710613a
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 10 deletions.
52 changes: 46 additions & 6 deletions cts.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,15 @@
"a": "A",
"b": "B"
},
"result": [
"A",
"B"
"results": [
[
"A",
"B"
],
[
"B",
"A"
]
]
},
{
Expand Down Expand Up @@ -135,9 +141,15 @@
"b": "By"
}
},
"result": [
"Ax",
"Ay"
"results": [
[
"Ax",
"Ay"
],
[
"Ay",
"Ax"
]
]
},
{
Expand Down Expand Up @@ -464,6 +476,34 @@
"f"
]
},
{
"name": "basic, descendant segment, object traversal, multiple selectors",
"selector": "$..['a','d']",
"document": {
"x": {
"a": "b",
"d": "e"
},
"y": {
"a": "c",
"d": "f"
}
},
"results": [
[
"b",
"e",
"c",
"f"
],
[
"c",
"f",
"b",
"e"
]
]
},
{
"name": "basic, bald descendant segment",
"selector": "$..",
Expand Down
30 changes: 26 additions & 4 deletions tests/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,13 @@
"a": "A",
"b": "B"
},
"result": [
"results": [[
"A",
"B"
]
],[
"B",
"A"
]]
},
{
"name": "wildcard shorthand, array data",
Expand Down Expand Up @@ -134,10 +137,13 @@
"b": "By"
}
},
"result": [
"results": [[
"Ax",
"Ay"
]
],[
"Ay",
"Ax"
]]
},
{
"name": "multiple selectors",
Expand Down Expand Up @@ -424,6 +430,22 @@
"f"
]
},
{
"name": "descendant segment, object traversal, multiple selectors",
"selector" : "$..['a','d']",
"document" : {"x": {"a": "b", "d": "e"}, "y": {"a":"c", "d": "f"}},
"results": [[
"b",
"e",
"c",
"f"
],[
"c",
"f",
"b",
"e"
]]
},
{
"name": "bald descendant segment",
"selector": "$..",
Expand Down

0 comments on commit 710613a

Please sign in to comment.