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

Function TestDisplayURL

internal/text/text_test.go:183–216  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

181}
182
183func TestDisplayURL(t *testing.T) {
184 tests := []struct {
185 name string
186 url string
187 want string
188 }{
189 {
190 name: "simple",
191 url: "https://github.com/cli/cli/issues/9470",
192 want: "https://github.com/cli/cli/issues/9470",
193 },
194 {
195 name: "without scheme",
196 url: "github.com/cli/cli/issues/9470",
197 want: "https://github.com/cli/cli/issues/9470",
198 },
199 {
200 name: "with query param and anchor",
201 url: "https://github.com/cli/cli/issues/9470?q=is:issue#issue-command",
202 want: "https://github.com/cli/cli/issues/9470",
203 },
204 {
205 name: "preserve http protocol use despite insecure",
206 url: "http://github.com/cli/cli/issues/9470",
207 want: "http://github.com/cli/cli/issues/9470",
208 },
209 }
210
211 for _, tt := range tests {
212 t.Run(tt.name, func(t *testing.T) {
213 assert.Equal(t, tt.want, DisplayURL(tt.url))
214 })
215 }
216}
217
218func TestFormatSize(t *testing.T) {
219 tests := []struct {

Callers

nothing calls this directly

Calls 3

DisplayURLFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected