Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/irevoire/arbitrary-json

Implement Arbitrary on serde_json
https://github.com/irevoire/arbitrary-json

fuzzing json rust testing

Last synced: 9 days ago
JSON representation

Implement Arbitrary on serde_json

Awesome Lists containing this project

README

        

Arbitrary JSON
==============

This crate provide a compatibility layer between
[serde_json](https://github.com/serde-rs/json) and
[arbitrary](https://github.com/rust-fuzz/arbitrary).
This allow you to generate random valid json when fuzzing your rust code. See
the following example:

```rust
#![no_main]
use arbitrary_json::ArbitraryValue;
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: ArbitraryValue| {
// call your very complex code here
if data["truc"] == serde_json::json!(42) {
panic!("Found the magic value");
}
});
```