17 lines
317 B
Rust
17 lines
317 B
Rust
|
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");
|
||
|
}
|