mirror of
https://github.com/tlsnotary/tlsn-utils.git
synced 2026-01-08 04:13:59 -05:00
* clippy fixes * fmt fixes * mirgrate to 2024 and fix workspace warning * fix profile * rustfmt --------- Co-authored-by: sinu <65924192+sinui0@users.noreply.github.com>
25 lines
612 B
Rust
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);
|
|
});
|