(t *testing.T, client *http.Client, URL string)
| 113 | } |
| 114 | |
| 115 | func testLoginRequest(t *testing.T, client *http.Client, URL string) { |
| 116 | res, err := client.Get(URL) |
| 117 | if err != nil { |
| 118 | t.Fatal(err) |
| 119 | } |
| 120 | body, err := io.ReadAll(res.Body) |
| 121 | if err != nil { |
| 122 | t.Fatal(err) |
| 123 | } |
| 124 | const exp = "authorized" |
| 125 | if string(body) != exp { |
| 126 | t.Errorf("got %q (instead of %v)", string(body), exp) |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | func TestBasicAuth(t *testing.T) { |
| 131 | for _, d := range []struct { |
no test coverage detected