roc/crates/compiler/test_syntax/fuzz/fuzz_targets/fuzz_module.rs
2024-11-30 18:43:16 +01:00

14 lines
369 B
Rust

#![no_main]
use libfuzzer_sys::fuzz_target;
use bumpalo::Bump;
use test_syntax::test_helpers::Input;
fuzz_target!(|data: &[u8]| {
if let Ok(input) = std::str::from_utf8(data) {
let input = Input::Full(input);
let arena = Bump::new();
if input.parse_in(&arena).is_ok() {
input.check_invariants(|_| (), true);
}
}
});