Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,661 changes: 1,614 additions & 47 deletions cts.json

Large diffs are not rendered by default.

535 changes: 473 additions & 62 deletions tests/basic.json

Large diffs are not rendered by default.

2,996 changes: 2,556 additions & 440 deletions tests/filter.json

Large diffs are not rendered by default.

66 changes: 54 additions & 12 deletions tests/functions/count.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@
"d": "f"
}
],
"tags": ["function", "count"]
"tags": [
"function",
"count"
],
"result_paths": [
"$[0]",
"$[1]"
]
},
{
"name": "single-node arg",
Expand All @@ -62,7 +69,11 @@
}
],
"result": [],
"tags": ["function", "count"]
"tags": [
"function",
"count"
],
"result_paths": []
},
{
"name": "multiple-selector arg",
Expand Down Expand Up @@ -98,55 +109,86 @@
"d": "f"
}
],
"tags": ["function", "count"]
"tags": [
"function",
"count"
],
"result_paths": [
"$[1]",
"$[2]"
]
},
{
"name": "non-query arg, number",
"selector": "$[?count(1)>2]",
"invalid_selector": true,
"tags": ["function", "count"]
"tags": [
"function",
"count"
]
},
{
"name": "non-query arg, string",
"selector": "$[?count('string')>2]",
"invalid_selector": true,
"tags": ["function", "count"]
"tags": [
"function",
"count"
]
},
{
"name": "non-query arg, true",
"selector": "$[?count(true)>2]",
"invalid_selector": true,
"tags": ["function", "count"]
"tags": [
"function",
"count"
]
},
{
"name": "non-query arg, false",
"selector": "$[?count(false)>2]",
"invalid_selector": true,
"tags": ["function", "count"]
"tags": [
"function",
"count"
]
},
{
"name": "non-query arg, null",
"selector": "$[?count(null)>2]",
"invalid_selector": true,
"tags": ["function", "count"]
"tags": [
"function",
"count"
]
},
{
"name": "result must be compared",
"selector": "$[?count(@..*)]",
"invalid_selector": true,
"tags": ["function", "count"]
"tags": [
"function",
"count"
]
},
{
"name": "no params",
"selector": "$[?count()==1]",
"invalid_selector": true,
"tags": ["function", "count"]
"tags": [
"function",
"count"
]
},
{
"name": "too many params",
"selector": "$[?count(@.a,@.b)==1]",
"invalid_selector": true,
"tags": ["function", "count"]
"tags": [
"function",
"count"
]
}
]
}
}
Loading
Loading