afl: mv parse target impl to lib

This commit is contained in:
Noah Hellman 2023-03-12 18:38:29 +01:00
parent 2606e2f4fc
commit 3e56903885
2 changed files with 6 additions and 7 deletions

5
tests/afl/src/lib.rs Normal file
View file

@ -0,0 +1,5 @@
pub fn parse(data: &[u8]) {
if let Ok(s) = std::str::from_utf8(data) {
jotdown::Parser::new(s).last();
}
}

View file

@ -1,9 +1,3 @@
use afl::fuzz;
fn main() {
fuzz!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
jotdown::Parser::new(s).last().unwrap();
}
});
afl::fuzz!(|data: &[u8]| { jotdown_afl::parse(data) });
}