From 9f49d1fd795e23286de1f2011303b5357922c828 Mon Sep 17 00:00:00 2001 From: FranciscaOrtegaG Date: Wed, 1 Nov 2023 16:56:12 -0300 Subject: [PATCH] host name to host addres trnaslation test done --- src/resolver/async_resolver.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/resolver/async_resolver.rs b/src/resolver/async_resolver.rs index 31f027bc..2cea4e45 100644 --- a/src/resolver/async_resolver.rs +++ b/src/resolver/async_resolver.rs @@ -123,5 +123,17 @@ mod async_resolver_test { } + #[tokio::test] + async fn host_name_to_host_address_translation() { + let resolver = AsyncResolver::new(ResolverConfig::default()); + let domain_name = "example.com"; + let transport_protocol = "UDP"; + let ip_address = resolver.lookup_ip(domain_name, transport_protocol).await.unwrap(); + + assert!(ip_address.is_ipv4()); + + assert!(!ip_address.is_unspecified()); + } + } \ No newline at end of file