| Crates.io | rsonpath-syntax-proptest |
| lib.rs | rsonpath-syntax-proptest |
| version | 0.4.0 |
| created_at | 2024-12-31 01:01:14.4145+00 |
| updated_at | 2025-01-02 22:19:01.932721+00 |
| description | Test utilities for JSONPath. |
| homepage | https://rsonquery.github.io/rsonpath/ |
| repository | https://github.com/rsonquery/rsonpath |
| max_upload_size | |
| id | 1499626 |
| size | 34,066 |
rsonpath-syntax-proptest – proptest::Arbitrary implementation for rsonpath-syntaxUtilities for property testing with types in rsonpath-syntax.
The crate exposes two types, ArbitraryJsonPathQuery and ArbitraryJsonPathQueryParam.
The ArbitraryJsonPathQuery implements proptest::Arbitrary
which generates an arbitrary JSONPath query string representation and rsonpath_syntax::JsonPathQuery object.
This is mostly used for internal testing of rsonpath-lib and rsonpath-syntax, but it is in general useful
for property-testing or fuzzing code that relies on JSONPath queries as input.
Example usage with proptest:
use proptest::prelude::*;
use rsonpath_syntax_proptest::ArbitraryJsonPathQuery;
proptest! {
#[test]
fn example(ArbitraryJsonPathQuery { parsed, string } in prop::arbitrary::any::<ArbitraryJsonPathQuery>()) {
// Your test using parsed (JsonPathQuery) and/or string (String).
}
}