Skip to content

Commit

Permalink
test(fuzz): Show reproduction cases
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Apr 19, 2024
1 parent 715616f commit ce2275f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/toml_edit_fuzz/parse_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ use toml_edit::Document;

libfuzzer_sys::fuzz_target!(|data| {
if let Ok(data) = std::str::from_utf8(data) {
println!("parsing: {data:?}");
let doc = data.parse::<Document>();
if let Ok(doc) = doc {
let toml = doc.to_string();
println!("parsing: {toml:?}");
let doc = toml.parse::<Document>();
assert!(
doc.is_ok(),
Expand Down

0 comments on commit ce2275f

Please sign in to comment.