(t *testing.T)
| 149 | } |
| 150 | |
| 151 | func 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 | |
| 186 | func TestFormatSize(t *testing.T) { |
| 187 | tests := []struct { |
nothing calls this directly
no test coverage detected