From 640c103c0a2b92f7f2a49cfc0721577f40aa90e0 Mon Sep 17 00:00:00 2001 From: Christian Murphy Date: Mon, 12 Sep 2022 01:01:11 -0700 Subject: Add fuzz testing Closes GH-7. --- fuzz/fuzz_targets/micromark.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 fuzz/fuzz_targets/micromark.rs (limited to 'fuzz/fuzz_targets/micromark.rs') diff --git a/fuzz/fuzz_targets/micromark.rs b/fuzz/fuzz_targets/micromark.rs new file mode 100644 index 0000000..f4d2927 --- /dev/null +++ b/fuzz/fuzz_targets/micromark.rs @@ -0,0 +1,16 @@ +#![no_main] +use libfuzzer_sys::fuzz_target; +extern crate micromark; + +fuzz_target!(|data: &[u8]| { + if let Ok(s) = std::str::from_utf8(data) { + let _ = micromark::micromark(s); + let _ = micromark::micromark_with_options( + s, + µmark::Options { + constructs: micromark::Constructs::gfm(), + ..micromark::Options::default() + }, + ); + } +}); -- cgit