rust-dnsbox/lib/dnsbox-base/src/records/tests.rs

17 lines
317 B
Rust
Raw Normal View History

2017-12-16 20:58:18 +00:00
use bytes::Bytes;
use records::structs;
use ser::packet::deserialize;
use ser::RRData;
fn check<T>(txt: &str, data: &'static [u8])
where
T: RRData
{
let d: T = deserialize(Bytes::from_static(data)).expect("couldn't parse record");
}
#[test]
fn test_a() {
check::<structs::A>("127.0.0.1", b"\x7f\x00\x00\x01");
}