fix(fuzz): update fuzz test target

This commit is contained in:
PoiScript 2019-10-09 13:38:23 +08:00
parent c3b07fdd9e
commit a8861cbe9c
2 changed files with 7 additions and 7 deletions

View file

@ -7,10 +7,9 @@ publish = false
[package.metadata] [package.metadata]
cargo-fuzz = true cargo-fuzz = true
[dependencies.orgize] [dependencies]
path = ".." libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" }
[dependencies.libfuzzer-sys] orgize = { path = ".." }
git = "https://github.com/rust-fuzz/libfuzzer-sys.git"
# Prevent this from interfering with workspaces # Prevent this from interfering with workspaces
[workspace] [workspace]

View file

@ -1,13 +1,14 @@
#![no_main] #![no_main]
#[macro_use] #[macro_use]
extern crate libfuzzer_sys; extern crate libfuzzer_sys;
extern crate orgize; extern crate orgize;
use orgize::Parser; use orgize::Org;
#[cfg_attr(rustfmt, rustfmt_skip)] #[cfg_attr(rustfmt, rustfmt_skip)]
fuzz_target!(|data: &[u8]| { libfuzzer_sys::fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) { if let Ok(s) = std::str::from_utf8(data) {
let _ = Parser::new(s).collect::<Vec<_>>(); let _ = Org::parse(s);
} }
}); });