MCPcopy Index your code
hub / github.com/coder/coder / TestEscapePathPreserveSlashes

Function TestEscapePathPreserveSlashes

coderd/externalauth/gitprovider/github_test.go:966–975  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

964}
965
966func TestEscapePathPreserveSlashes(t *testing.T) {
967 t.Parallel()
968 // The function is unexported, so test it indirectly via BuildBranchURL.
969 // A branch with a space in a segment should be escaped, but slashes preserved.
970 gp, err := gitprovider.New("github", "", nil)
971 require.NoError(t, err)
972 require.NotNil(t, gp)
973 got := gp.BuildBranchURL("owner", "repo", "feat/my thing")
974 assert.Equal(t, "https://github.com/owner/repo/tree/feat/my%20thing", got)
975}

Callers

nothing calls this directly

Calls 3

NewFunction · 0.92
BuildBranchURLMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected