forked from biomejs/biome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrome_parse_all.rs
35 lines (31 loc) · 903 Bytes
/
rome_parse_all.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#![no_main]
mod rome_parse_d_ts;
mod rome_parse_jsx;
mod rome_parse_module;
mod rome_parse_script;
mod rome_parse_tsx;
mod rome_parse_typescript;
use libfuzzer_sys::{fuzz_target, Corpus};
fn do_fuzz(data: &[u8]) -> Corpus {
let mut keep = Corpus::Reject;
if let Corpus::Keep = rome_parse_d_ts::do_fuzz(data) {
keep = Corpus::Keep;
}
if let Corpus::Keep = rome_parse_jsx::do_fuzz(data) {
keep = Corpus::Keep;
}
if let Corpus::Keep = rome_parse_module::do_fuzz(data) {
keep = Corpus::Keep;
}
if let Corpus::Keep = rome_parse_script::do_fuzz(data) {
keep = Corpus::Keep;
}
if let Corpus::Keep = rome_parse_tsx::do_fuzz(data) {
keep = Corpus::Keep;
}
if let Corpus::Keep = rome_parse_typescript::do_fuzz(data) {
keep = Corpus::Keep;
}
keep
}
fuzz_target!(|case: &[u8]| -> Corpus { do_fuzz(case) });