MCPcopy Create free account
hub / github.com/cli/cli / TestImmutableSafeURLString

Function TestImmutableSafeURLString

internal/safeurl/safeurl_test.go:295–317  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

293}
294
295func TestImmutableSafeURLString(t *testing.T) {
296 tests := []struct {
297 name string
298 url string
299 want string
300 }{
301 {
302 name: "empty renders empty",
303 url: "",
304 want: "",
305 },
306 {
307 name: "renders the wrapped url verbatim without encoding",
308 url: "https://host/foo/bar baz/?value=x y",
309 want: "https://host/foo/bar baz/?value=x y",
310 },
311 }
312 for _, tt := range tests {
313 t.Run(tt.name, func(t *testing.T) {
314 require.Equal(t, tt.want, safeurl.NewImmutableSafeURL(tt.url).String())
315 })
316 }
317}

Callers

nothing calls this directly

Calls 4

NewImmutableSafeURLFunction · 0.92
EqualMethod · 0.80
RunMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected