diff --git a/src/message/rdata/cname_rdata.rs b/src/message/rdata/cname_rdata.rs index 2a45f352..d1230cff 100644 --- a/src/message/rdata/cname_rdata.rs +++ b/src/message/rdata/cname_rdata.rs @@ -126,6 +126,7 @@ impl CnameRdata { #[cfg(test)] mod cname_rdata_test { use crate::domain_name::DomainName; + use crate::message::rdata::Rdata; use crate::message::rdata::cname_rdata::CnameRdata; use crate::message::Rtype; use crate::message::Rclass; @@ -179,7 +180,7 @@ mod cname_rdata_test { #[test] fn rr_from_master_file_test() { let cname_rr = CnameRdata::rr_from_master_file( - "test.googleplex.edu".split_whitespace(), + "test.googleplex.edu.".split_whitespace(), 0, "IN", "admin1.googleplex.edu".to_string(), @@ -193,15 +194,15 @@ mod cname_rdata_test { ); assert_eq!(cname_rr.get_rtype(), Rtype::CNAME); assert_eq!(cname_rr.get_ttl(), 0); - assert_eq!(cname_rr.get_rdlength(), 21); + assert_eq!(cname_rr.get_rdlength(), 22); - // TODO: Implement getters for complete coverage - /* - let mut a_rdata = cname_rr.get_rdata(); + let expected_cname = DomainName::new_from_string(String::from("test.googleplex.edu.")); + + let a_rdata = cname_rr.get_rdata(); match a_rdata { - Rdata::SomeCnameRdata(val) => assert_eq!(val.get_address(), [204, 13, 100, 3]), + Rdata::SomeCnameRdata(val) => assert_eq!(val.get_cname(), expected_cname), _ => {} } - */ + } }