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]
cargo-fuzz = true
[dependencies.orgize]
path = ".."
[dependencies.libfuzzer-sys]
git = "https://github.com/rust-fuzz/libfuzzer-sys.git"
[dependencies]
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" }
orgize = { path = ".." }
# Prevent this from interfering with workspaces
[workspace]

View file

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