create the json-depth-checker crate

This commit is contained in:
Tamo 2022-04-11 18:43:44 +02:00 committed by Irevoire
parent 7791ef90e7
commit c2469b6765
No known key found for this signature in database
GPG key ID: 7A6A970C96104F1B
6 changed files with 230 additions and 1 deletions

View file

@ -0,0 +1,13 @@
#![no_main]
use arbitrary_json::ArbitraryValue;
use json_depth_checker::*;
use libfuzzer_sys::fuzz_target;
fuzz_target!(|value: ArbitraryValue| {
let value = serde_json::Value::from(value);
let left = should_flatten_from_value(&value);
let value = serde_json::to_vec(&value).unwrap();
let right = should_flatten_from_unchecked_slice(&value);
assert_eq!(left, right);
});