MCPcopy
hub / github.com/cli/cli / TestDisplayURL

Function TestDisplayURL

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

Source from the content-addressed store, hash-verified

149}
150
151func TestDisplayURL(t *testing.T) {
152 tests := []struct {
153 name string
154 url string
155 want string
156 }{
157 {
158 name: "simple",
159 url: "https://github.com/cli/cli/issues/9470",
160 want: "https://github.com/cli/cli/issues/9470",
161 },
162 {
163 name: "without scheme",
164 url: "github.com/cli/cli/issues/9470",
165 want: "https://github.com/cli/cli/issues/9470",
166 },
167 {
168 name: "with query param and anchor",
169 url: "https://github.com/cli/cli/issues/9470?q=is:issue#issue-command",
170 want: "https://github.com/cli/cli/issues/9470",
171 },
172 {
173 name: "preserve http protocol use despite insecure",
174 url: "http://github.com/cli/cli/issues/9470",
175 want: "http://github.com/cli/cli/issues/9470",
176 },
177 }
178
179 for _, tt := range tests {
180 t.Run(tt.name, func(t *testing.T) {
181 assert.Equal(t, tt.want, DisplayURL(tt.url))
182 })
183 }
184}
185
186func TestFormatSize(t *testing.T) {
187 tests := []struct {

Callers

nothing calls this directly

Calls 3

DisplayURLFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected