-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
5,304 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
crates/rsonpath-lib/tests/documents/toml/atomic_root_empty_string.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Define the JSON input for all query test cases. | ||
[input] | ||
# Short description of the input structure. | ||
description = "The root is an empty string." | ||
# Set to true only if your specific test input is fully compressed (no extraneous whitespace). | ||
is_compressed = true | ||
|
||
# Inline JSON document. | ||
[input.source] | ||
json_string = '""' | ||
|
||
# Define queries to test on the input. | ||
[[queries]] | ||
# Valid JSONPath query string. | ||
query = "$" | ||
# Short descritpion of the query semantics. | ||
description = "select the root" | ||
|
||
[queries.results] | ||
# Number of expected matches. | ||
count = 1 | ||
# Byte locations of spans of all matches, in order. | ||
spans = [[0, 2]] | ||
# Stringified values of all matches, verbatim as in the input, | ||
# in the same order as above. | ||
nodes = ['""'] | ||
|
||
[[queries]] | ||
query = "$..*" | ||
description = "select all subdocuments of which there are none" | ||
|
||
[queries.results] | ||
count = 0 | ||
spans = [] | ||
nodes = [] | ||
|
||
[[queries]] | ||
query = '$[""]' | ||
description = "look for an empty key which should not match the root" | ||
|
||
[queries.results] | ||
count = 0 | ||
spans = [] | ||
nodes = [] |
35 changes: 35 additions & 0 deletions
35
crates/rsonpath-lib/tests/documents/toml/atomic_root_false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Define the JSON input for all query test cases. | ||
[input] | ||
# Short description of the input structure. | ||
description = "The root is the atomic value false." | ||
# Set to true only if your specific test input is fully compressed (no extraneous whitespace). | ||
is_compressed = true | ||
|
||
# Inline JSON document. | ||
[input.source] | ||
json_string = "false" | ||
|
||
# Define queries to test on the input. | ||
[[queries]] | ||
# Valid JSONPath query string. | ||
query = "$" | ||
# Short descritpion of the query semantics. | ||
description = "select the root" | ||
|
||
[queries.results] | ||
# Number of expected matches. | ||
count = 1 | ||
# Byte locations of spans of all matches, in order. | ||
spans = [[0, 5]] | ||
# Stringified values of all matches, verbatim as in the input, | ||
# in the same order as above. | ||
nodes = ["false"] | ||
|
||
[[queries]] | ||
query = "$..*" | ||
description = "select all subdocuments of which there are none" | ||
|
||
[queries.results] | ||
count = 0 | ||
spans = [] | ||
nodes = [] |
44 changes: 44 additions & 0 deletions
44
crates/rsonpath-lib/tests/documents/toml/atomic_root_nonempty_string.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Define the JSON input for all query test cases. | ||
[input] | ||
# Short description of the input structure. | ||
description = "The root is a non-empty string." | ||
# Set to true only if your specific test input is fully compressed (no extraneous whitespace). | ||
is_compressed = true | ||
|
||
# Inline JSON document. | ||
[input.source] | ||
json_string = '"some string"' | ||
|
||
# Define queries to test on the input. | ||
[[queries]] | ||
# Valid JSONPath query string. | ||
query = "$" | ||
# Short descritpion of the query semantics. | ||
description = "select the root" | ||
|
||
[queries.results] | ||
# Number of expected matches. | ||
count = 1 | ||
# Byte locations of spans of all matches, in order. | ||
spans = [[0, 13]] | ||
# Stringified values of all matches, verbatim as in the input, | ||
# in the same order as above. | ||
nodes = ['"some string"'] | ||
|
||
[[queries]] | ||
query = "$..*" | ||
description = "select all subdocuments of which there are none" | ||
|
||
[queries.results] | ||
count = 0 | ||
spans = [] | ||
nodes = [] | ||
|
||
[[queries]] | ||
query = '$["some string"]' | ||
description = "look for the key equal to the root value, which should not match" | ||
|
||
[queries.results] | ||
count = 0 | ||
spans = [] | ||
nodes = [] |
35 changes: 35 additions & 0 deletions
35
crates/rsonpath-lib/tests/documents/toml/atomic_root_null.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Define the JSON input for all query test cases. | ||
[input] | ||
# Short description of the input structure. | ||
description = "The root is the atomic value null." | ||
# Set to true only if your specific test input is fully compressed (no extraneous whitespace). | ||
is_compressed = true | ||
|
||
# Inline JSON document. | ||
[input.source] | ||
json_string = "null" | ||
|
||
# Define queries to test on the input. | ||
[[queries]] | ||
# Valid JSONPath query string. | ||
query = "$" | ||
# Short descritpion of the query semantics. | ||
description = "select the root" | ||
|
||
[queries.results] | ||
# Number of expected matches. | ||
count = 1 | ||
# Byte locations of spans of all matches, in order. | ||
spans = [[0, 4]] | ||
# Stringified values of all matches, verbatim as in the input, | ||
# in the same order as above. | ||
nodes = ["null"] | ||
|
||
[[queries]] | ||
query = "$..*" | ||
description = "select all subdocuments of which there are none" | ||
|
||
[queries.results] | ||
count = 0 | ||
spans = [] | ||
nodes = [] |
35 changes: 35 additions & 0 deletions
35
crates/rsonpath-lib/tests/documents/toml/atomic_root_number_float.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Define the JSON input for all query test cases. | ||
[input] | ||
# Short description of the input structure. | ||
description = "The root is an atomic floating-point number." | ||
# Set to true only if your specific test input is fully compressed (no extraneous whitespace). | ||
is_compressed = true | ||
|
||
# Inline JSON document. | ||
[input.source] | ||
json_string = "123456789.1337" | ||
|
||
# Define queries to test on the input. | ||
[[queries]] | ||
# Valid JSONPath query string. | ||
query = "$" | ||
# Short descritpion of the query semantics. | ||
description = "select the root" | ||
|
||
[queries.results] | ||
# Number of expected matches. | ||
count = 1 | ||
# Byte locations of spans of all matches, in order. | ||
spans = [[0, 14]] | ||
# Stringified values of all matches, verbatim as in the input, | ||
# in the same order as above. | ||
nodes = ["123456789.1337"] | ||
|
||
[[queries]] | ||
query = "$..*" | ||
description = "select all subdocuments of which there are none" | ||
|
||
[queries.results] | ||
count = 0 | ||
spans = [] | ||
nodes = [] |
35 changes: 35 additions & 0 deletions
35
crates/rsonpath-lib/tests/documents/toml/atomic_root_number_integer.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Define the JSON input for all query test cases. | ||
[input] | ||
# Short description of the input structure. | ||
description = "The root is an atomic integral number." | ||
# Set to true only if your specific test input is fully compressed (no extraneous whitespace). | ||
is_compressed = true | ||
|
||
# Inline JSON document. | ||
[input.source] | ||
json_string = "123456789" | ||
|
||
# Define queries to test on the input. | ||
[[queries]] | ||
# Valid JSONPath query string. | ||
query = "$" | ||
# Short descritpion of the query semantics. | ||
description = "select the root" | ||
|
||
[queries.results] | ||
# Number of expected matches. | ||
count = 1 | ||
# Byte locations of spans of all matches, in order. | ||
spans = [[0, 9]] | ||
# Stringified values of all matches, verbatim as in the input, | ||
# in the same order as above. | ||
nodes = ["123456789"] | ||
|
||
[[queries]] | ||
query = "$..*" | ||
description = "select all subdocuments of which there are none" | ||
|
||
[queries.results] | ||
count = 0 | ||
spans = [] | ||
nodes = [] |
35 changes: 35 additions & 0 deletions
35
crates/rsonpath-lib/tests/documents/toml/atomic_root_number_scientific_notation.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Define the JSON input for all query test cases. | ||
[input] | ||
# Short description of the input structure. | ||
description = "The root is an atomic floating-point number in scientific notation." | ||
# Set to true only if your specific test input is fully compressed (no extraneous whitespace). | ||
is_compressed = true | ||
|
||
# Inline JSON document. | ||
[input.source] | ||
json_string = "123456789.1337e-25" | ||
|
||
# Define queries to test on the input. | ||
[[queries]] | ||
# Valid JSONPath query string. | ||
query = "$" | ||
# Short descritpion of the query semantics. | ||
description = "select the root" | ||
|
||
[queries.results] | ||
# Number of expected matches. | ||
count = 1 | ||
# Byte locations of spans of all matches, in order. | ||
spans = [[0, 18]] | ||
# Stringified values of all matches, verbatim as in the input, | ||
# in the same order as above. | ||
nodes = ["123456789.1337e-25"] | ||
|
||
[[queries]] | ||
query = "$..*" | ||
description = "select all subdocuments of which there are none" | ||
|
||
[queries.results] | ||
count = 0 | ||
spans = [] | ||
nodes = [] |
35 changes: 35 additions & 0 deletions
35
crates/rsonpath-lib/tests/documents/toml/atomic_root_true.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Define the JSON input for all query test cases. | ||
[input] | ||
# Short description of the input structure. | ||
description = "The root is the atomic value true." | ||
# Set to true only if your specific test input is fully compressed (no extraneous whitespace). | ||
is_compressed = true | ||
|
||
# Inline JSON document. | ||
[input.source] | ||
json_string = "true" | ||
|
||
# Define queries to test on the input. | ||
[[queries]] | ||
# Valid JSONPath query string. | ||
query = "$" | ||
# Short descritpion of the query semantics. | ||
description = "select the root" | ||
|
||
[queries.results] | ||
# Number of expected matches. | ||
count = 1 | ||
# Byte locations of spans of all matches, in order. | ||
spans = [[0, 4]] | ||
# Stringified values of all matches, verbatim as in the input, | ||
# in the same order as above. | ||
nodes = ["true"] | ||
|
||
[[queries]] | ||
query = "$..*" | ||
description = "select all subdocuments of which there are none" | ||
|
||
[queries.results] | ||
count = 0 | ||
spans = [] | ||
nodes = [] |
Oops, something went wrong.