| 125 | } |
| 126 | |
| 127 | func TestRequestAbsPathPreservesTrailingSlash(t *testing.T) { |
| 128 | r := (&Request{baseURL: &url.URL{}}).AbsPath("/foo/") |
| 129 | if s := r.URL().String(); s != "/foo/" { |
| 130 | t.Errorf("trailing slash should be preserved: %s", s) |
| 131 | } |
| 132 | |
| 133 | r = (&Request{baseURL: &url.URL{}}).AbsPath("/foo/") |
| 134 | if s := r.URL().String(); s != "/foo/" { |
| 135 | t.Errorf("trailing slash should be preserved: %s", s) |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | func TestRequestAbsPathJoins(t *testing.T) { |
| 140 | r := (&Request{baseURL: &url.URL{}}).AbsPath("foo/bar", "baz") |