Skip to content

Commit

Permalink
test from bytes for DNAME type code
Browse files Browse the repository at this point in the history
  • Loading branch information
Litr0 committed Oct 31, 2023
1 parent c242a2e commit 71e2551
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/message/rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,20 @@ mod resolver_query_tests {
}
}

#[test]
fn from_bytes_dname_rdata(){
let data_bytes = [5, 100, 110, 97, 109, 101, 0, 0, 39, 0, 1];
let rdata = Rdata::from_bytes(&data_bytes, &data_bytes).unwrap();
let name = String::from("dname");

match rdata {
Rdata::SomeCnameRdata(val) => {
assert_eq!(val.get_cname().get_name(), name);
}
_ => {}
}
}

#[test]
fn from_bytes_hinfo_rdata(){
let data_bytes = [99, 112, 117, 0, 111, 115, 0, 0, 13, 0, 1];
Expand Down

0 comments on commit 71e2551

Please sign in to comment.