(t *testing.T, url, exp string)
| 175 | } |
| 176 | |
| 177 | func expectURLToContain(t *testing.T, url, exp string) { |
| 178 | res, err := http.Get(url) |
| 179 | if err != nil { |
| 180 | t.Error(err) |
| 181 | return |
| 182 | } |
| 183 | |
| 184 | if res.StatusCode != 200 { |
| 185 | t.Errorf("Got %s instead of 200 OK", res.Status) |
| 186 | return |
| 187 | } |
| 188 | |
| 189 | data, err := io.ReadAll(res.Body) |
| 190 | res.Body.Close() |
| 191 | if err != nil { |
| 192 | t.Error(err) |
| 193 | return |
| 194 | } |
| 195 | |
| 196 | if string(data) != exp { |
| 197 | t.Errorf("Got %q instead of %q on %q", data, exp, url) |
| 198 | return |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | func TestDirNames(t *testing.T) { |
| 203 | t.Parallel() |
no test coverage detected