mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
improve the fuzzer of the flatten crate
This commit is contained in:
parent
c7d0097c97
commit
d81a3f4a74
2 changed files with 8 additions and 3 deletions
|
@ -1,8 +1,12 @@
|
|||
#![no_main]
|
||||
use arbitrary_json::ArbitraryObject;
|
||||
use flatten_serde_json::flatten;
|
||||
use json_depth_checker::should_flatten_from_value;
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
fuzz_target!(|object: ArbitraryObject| {
|
||||
let _ = flatten(&object);
|
||||
let object = flatten(&object);
|
||||
if !object.is_empty() {
|
||||
assert!(object.values().any(|value| !should_flatten_from_value(value)));
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue