diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index bedaeaa..3b3f200 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -33,3 +33,10 @@ path = "fuzz_targets/display_parse_tree.rs" test = false doc = false bench = false + +[[bin]] +name = "reconstruct_value" +path = "fuzz_targets/reconstruct_value.rs" +test = false +doc = false +bench = false diff --git a/fuzz/fuzz_targets/reconstruct_value.rs b/fuzz/fuzz_targets/reconstruct_value.rs new file mode 100644 index 0000000..cbe8a61 --- /dev/null +++ b/fuzz/fuzz_targets/reconstruct_value.rs @@ -0,0 +1,11 @@ +#![no_main] + +use libfuzzer_sys::fuzz_target; + +use simfony::value::{Value, StructuralValue}; + +fuzz_target!(|value: Value| { + let structural_value = StructuralValue::from(&value); + let reconstructed_value = Value::reconstruct(&structural_value, value.ty()).unwrap(); + assert_eq!(reconstructed_value, value); +});