MCPcopy
hub / github.com/kubernetes/client-go / TestRequestAbsPathPreservesTrailingSlash

Function TestRequestAbsPathPreservesTrailingSlash

rest/request_test.go:127–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

125}
126
127func 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
139func TestRequestAbsPathJoins(t *testing.T) {
140 r := (&Request{baseURL: &url.URL{}}).AbsPath("foo/bar", "baz")

Callers

nothing calls this directly

Calls 4

AbsPathMethod · 0.80
URLMethod · 0.80
StringMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected