add .invalid test

This commit is contained in:
Benjamin Fry 2018-01-24 22:21:04 -08:00
parent 0bbd87fe8a
commit 662fe4879d
2 changed files with 14 additions and 0 deletions

View File

@ -113,6 +113,7 @@ Zones will be automatically resigned on any record updates via dynamic DNS.
- [RFC 2782](https://tools.ietf.org/html/rfc2782): Service location
- [RFC 3596](https://tools.ietf.org/html/rfc3596): IPv6
- [RFC 6891](https://tools.ietf.org/html/rfc6891): Extension Mechanisms for DNS
- [RFC 6761](https://tools.ietf.org/html/rfc6761): Special-Use Domain Names (resolver)
### Update operations
- [RFC 2136](https://tools.ietf.org/html/rfc2136): Dynamic Update

View File

@ -834,4 +834,17 @@ mod tests {
.is_err()
);
}
#[test]
fn test_early_return_invalid() {
let cache = Arc::new(Mutex::new(DnsLru::new(0)));
let client = mock(vec![empty()]);
let mut client = CachingClient{lru: cache, client: client};
assert!(
client.lookup(Query::query(Name::from_ascii("horrible.invalid.").unwrap(), RecordType::A))
.wait()
.is_err()
);
}
}