Files
tlsn-utils/rangeset/fuzz/fuzz_targets/set_intersection_set.rs
th4s 6c9c40e68a chore: clippy, fmt, warnings (#64)
* clippy fixes

* fmt fixes

* mirgrate to 2024 and fix workspace warning

* fix profile

* rustfmt

---------

Co-authored-by: sinu <65924192+sinui0@users.noreply.github.com>
2025-05-01 10:09:50 -07:00

25 lines
612 B
Rust

#![no_main]
use std::collections::HashSet;
use libfuzzer_sys::fuzz_target;
use rangeset_fuzz::{SmallSet, assert_invariants};
use rangeset::*;
fuzz_target!(|r: (SmallSet, SmallSet)| {
let s1: RangeSet<u8> = r.0.into();
let s2: RangeSet<u8> = r.1.into();
let h1: HashSet<u8> = HashSet::from_iter(s1.iter());
let h2: HashSet<u8> = HashSet::from_iter(s2.iter());
let intersection = s1.intersection(&s2);
let h3: HashSet<u8> = HashSet::from_iter(intersection.iter());
assert_eq!(h3, h1.intersection(&h2).copied().collect::<HashSet<_>>());
assert_invariants(intersection);
});