Debian Codegraph @

tests/normalize.rs

raw symbols SCIP
1 #![cfg(feature = "alloc")]
2
3 #[cfg(feature = "net")]
4 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::netrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/::{Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#, Ipv6Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv6Addr#};
5
6 #[cfg(feature = "net")]
7 use fluent_urirust-analyzer cargo fluent-uri 0.4.1 crate/::componentrust-analyzer cargo fluent-uri 0.4.1 component/::Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#;
8
9 use fluent_urirust-analyzer cargo fluent-uri 0.4.1 crate/::{IriRefrust-analyzer cargo fluent-uri 0.4.1 imp/IriRef#, UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#};
10
11 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
12 fn normalizerust-analyzer cargo fluent-uri 0.4.1 normalize().() {
13 // Example from Section 6.2 of RFC 3986.
14 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("eXAMPLE://a/./b/../b/%63/%7bfoo%7d").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
15 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "example://a/b/c/%7Bfoo%7D");
16
17 // Examples from Section 6.2.3 of RFC 3986.
18
19 // An empty path is not normalized to "/" for now.
20 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("http://example.com").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
21 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "http://example.com");
22
23 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("http://example.com/").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
24 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "http://example.com/");
25
26 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("http://example.com:/").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
27 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "http://example.com/");
28
29 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("http://example.com:80/").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
30 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "http://example.com/");
31
32 // Lowercase percent-encoded octet.
33 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("%3a").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
34 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "%3A");
35
36 // Uppercase letters in scheme and registered name.
37 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("HTTP://www.EXAMPLE.com/").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
38 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "http://www.example.com/");
39
40 // Underflow in path resolution.
41 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("http://a/../../../g").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
42 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "http://a/g");
43
44 // Percent-encoded dot segments.
45 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("http://a/b/c/%2E/%2E./%2e%2E/d").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
46 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "http://a/d");
47
48 // Don't remove dot segments from relative reference or rootless path.
49 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("foo/../bar").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
50 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "foo/../bar");
51
52 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("/foo/../bar").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
53 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "/foo/../bar");
54
55 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("foo:bar/../baz").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
56 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "foo:bar/../baz");
57
58 // Do remove dot segments for a URI with absolute path.
59 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("foo:/bar/./../baz").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
60 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "foo:/baz");
61
62 // However, make sure that the output is a valid URI reference.
63 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("foo:/.//@@").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
64 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "foo:/.//@@");
65
66 // Percent-encoded uppercase letters in registered name.
67 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("HTTP://%45XAMPLE.%43Om").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
68 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "http://example.com");
69
70 // Percent-encoded unreserved characters.
71 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("%41%42%43%44%45%46%47%48%49%4A%4B%4C%4D%4E%4F%50%51%52%53%54%55%56%57%58%59%5A%61%62%63%64%65%66%67%68%69%6A%6B%6C%6D%6E%6F%70%71%72%73%74%75%76%77%78%79%7A%30%31%32%33%34%35%36%37%38%39%2D%2E%5F%7E").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
72 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
73 r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(),
74 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"
75 );
76
77 // Percent-encoded reserved characters.
78 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%25").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
79 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), r);
80
81 // Builder example.
82 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("foo://[email protected]:8042/over/there?name=ferret#nose").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
83 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), r);
84
85 // Normalization in all components.
86 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("FOO://%55se%72@EXamp%4ce%2ecom:8042/%4b%2f?%4c%2b#%24%4d").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
87 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "foo://[email protected]:8042/K%2F?L%2B#%24M");
88
89 // Normal IPv4 address.
90 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//127.0.0.1").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
91 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "//127.0.0.1");
92 #[cfg(feature = "net")]
93 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(
94 r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().().authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(),
95 Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::Ipv4rust-analyzer cargo fluent-uri 0.4.1 component/Host#Ipv4#(Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#::LOCALHOSTrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]LOCALHOST.)
96 ));
97
98 // Percent-encoded IPv4 address.
99 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//127.0.0.%31").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
100 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "//127.0.0.1");
101 #[cfg(feature = "net")]
102 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(
103 r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().().authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(),
104 Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::Ipv4rust-analyzer cargo fluent-uri 0.4.1 component/Host#Ipv4#(Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#::LOCALHOSTrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]LOCALHOST.)
105 ));
106
107 // Normal IPv6 address.
108 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//[::1]").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
109 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "//[::1]");
110 #[cfg(feature = "net")]
111 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(
112 r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().().authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(),
113 Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::Ipv6rust-analyzer cargo fluent-uri 0.4.1 component/Host#Ipv6#(Ipv6Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv6Addr#::LOCALHOSTrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv6Addr]LOCALHOST.)
114 ));
115
116 // Verbose IPv6 address.
117 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//[0000:0000:0000::1]").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
118 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "//[::1]");
119 #[cfg(feature = "net")]
120 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(
121 r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().().authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(),
122 Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::Ipv6rust-analyzer cargo fluent-uri 0.4.1 component/Host#Ipv6#(Ipv6Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv6Addr#::LOCALHOSTrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv6Addr]LOCALHOST.)
123 ));
124
125 // IPv4-mapped IPv6 address.
126 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//[0:0:0:0:0:ffff:192.0.2.1]").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
127 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "//[::ffff:192.0.2.1]");
128
129 // Deprecated IPv4-compatible IPv6 address.
130 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//[::192.0.2.1]").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
131 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "//[::c000:201]");
132
133 // IPvFuture address.
134 let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//[v1FdE.AddR]").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
135 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]normalize().(), "//[v1fde.addr]");
136 }
137
138 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
139 fn normalize_irirust-analyzer cargo fluent-uri 0.4.1 normalize_iri().() {
140 // Example from Section 5.3.2 of RFC 3987.
141 let r = IriRefrust-analyzer cargo fluent-uri 0.4.1 imp/IriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`IriRef<T>`]parse().("eXAMPLE://a/./b/../b/%63/%7bfoo%7d/ros%C3%A9").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
142 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`IriRef<T>`]normalize().(), "example://a/b/c/%7Bfoo%7D/rosé");
143
144 // Encoded private character in query.
145 let r = IriRefrust-analyzer cargo fluent-uri 0.4.1 imp/IriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`IriRef<T>`]parse().("?%EE%80%80").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
146 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.normalizerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`IriRef<T>`]normalize().(), "?\u{e000}");
147 }