From a1099e54f0895b156ca28b4f1abae8b34549b56f Mon Sep 17 00:00:00 2001 From: Revertron Date: Sun, 12 Sep 2021 13:47:05 +0200 Subject: [PATCH] Fixed CNAME resolution test. --- src/dns/server.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/dns/server.rs b/src/dns/server.rs index 1d645d3..91d6c60 100644 --- a/src/dns/server.rs +++ b/src/dns/server.rs @@ -497,18 +497,12 @@ mod tests { // A successful resolve, that also resolves a CNAME through recursive lookup { let res = execute_query(Arc::clone(&context), &build_query("www.microsoft.com", QueryType::CNAME)); - assert_eq!(2, res.answers.len()); + dbg!(&res); + assert_eq!(1, res.answers.len()); match res.answers[0] { - DnsRecord::CNAME { ref domain, .. } => { - assert_eq!("www.microsoft.com", domain); - } - _ => panic!() - } - - match res.answers[1] { - DnsRecord::A { ref domain, .. } => { - assert_eq!("cdn.microsoft.com", domain); + DnsRecord::CNAME { ref host, .. } => { + assert_eq!("cdn.microsoft.com", host); } _ => panic!() }