(t *testing.T)
| 181 | } |
| 182 | |
| 183 | func 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 | |
| 218 | func TestFormatSize(t *testing.T) { |
| 219 | tests := []struct { |
nothing calls this directly
no test coverage detected