aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorRichard Walters <rwalters@digitalstirling.com>2020-10-05 14:03:26 -0700
committerRichard Walters <rwalters@digitalstirling.com>2020-10-05 14:03:26 -0700
commitf95b6e2d031de4d59dafe094386da6d4a6074dad (patch)
tree18772e9de9afa60532150f14f4e766d7c20d684e /src/lib.rs
parentda7c16742836067e0a7e921679c54fe16b6fa7ae (diff)
Add tests for parsing hosts ending in dot
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 29e2c47..11b702e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -441,6 +441,17 @@ mod tests {
}
#[test]
+ fn parse_from_string_host_ends_in_dot() {
+ let uri = uriparse::URIReference::try_from("http://example.com./foo");
+ assert!(uri.is_ok());
+ let uri = uri.unwrap();
+ assert_eq!(
+ Some(&uriparse::Host::try_from("example.com.").unwrap()),
+ uri.host()
+ );
+ }
+
+ #[test]
fn parse_from_string_dont_misinterpret_colon_in_other_places_as_scheme_delimiter() {
let test_vectors = [
"//foo:bar@www.example.com/",