3 fn t(builder: UrlPartsBuilder, expect: &str) {
4 assert_eq!(builder.finish(), expect);
9 t(UrlPartsBuilder::new(), "");
14 t(UrlPartsBuilder::singleton("index.html"), "index.html");
19 let mut builder = UrlPartsBuilder::new();
22 builder.push("struct.Bytes.html");
23 t(builder, "core/str/struct.Bytes.html");
27 fn push_front_empty() {
28 let mut builder = UrlPartsBuilder::new();
29 builder.push_front("page.html");
30 t(builder, "page.html");
34 fn push_front_non_empty() {
35 let mut builder = UrlPartsBuilder::new();
38 builder.push("struct.Bytes.html");
39 builder.push_front("nightly");
40 t(builder, "nightly/core/str/struct.Bytes.html");
45 t(["core", "str"].into_iter().collect(), "core/str");
46 t(["core", "str", "struct.Bytes.html"].into_iter().collect(), "core/str/struct.Bytes.html");
51 let mut builder = UrlPartsBuilder::singleton("core");
52 builder.extend(["str", "struct.Bytes.html"]);
53 t(builder, "core/str/struct.Bytes.html");