This commit is contained in:
Mateusz Gruszczyński committed 2026-10-04 11:15:58 +02:00
1 parent 87e571c170
commit fa7abc9e53
308 files changed
+49746 -50237

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
mod tests {
use super::*;
#[test]
fn range_lookup_handles_gaps() {
let db = Database {
ipv4: vec![V4Range {
start: u32::from(Ipv4Addr::new(192, 0, 2, 0)),
end: u32::from(Ipv4Addr::new(192, 0, 2, 255)),
country: *b"PL",
}],
ipv6: vec![],
};
assert_eq!(
db.country("192.0.2.7".parse().unwrap()).as_deref(),
Some("PL")
);
assert!(db.country("198.51.100.1".parse().unwrap()).is_none());
}
}