MCPcopy Index your code
hub / github.com/google/go-github / TestResponse_populateSinceValues_invalid

Function TestResponse_populateSinceValues_invalid

github/github_test.go:2126–2165  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2124}
2125
2126func TestResponse_populateSinceValues_invalid(t *testing.T) {
2127 t.Parallel()
2128 r := http.Response{
2129 Header: http.Header{
2130 "Link": {
2131 `<https://api.github.com/?since=1>,` +
2132 `<https://api.github.com/?since=abc>; rel="first",` +
2133 `https://api.github.com/?since=2; rel="prev",` +
2134 `<https://api.github.com/>; rel="next",` +
2135 `<https://api.github.com/?since=>; rel="last"`,
2136 },
2137 },
2138 }
2139
2140 response := newResponse(&r)
2141 if got, want := response.FirstPage, 0; got != want {
2142 t.Errorf("response.FirstPage: %v, want %v", got, want)
2143 }
2144 if got, want := response.PrevPage, 0; got != want {
2145 t.Errorf("response.PrevPage: %v, want %v", got, want)
2146 }
2147 if got, want := response.NextPage, 0; got != want {
2148 t.Errorf("response.NextPage: %v, want %v", got, want)
2149 }
2150 if got, want := response.LastPage, 0; got != want {
2151 t.Errorf("response.LastPage: %v, want %v", got, want)
2152 }
2153
2154 // more invalid URLs
2155 r = http.Response{
2156 Header: http.Header{
2157 "Link": {`<https://api.github.com/%?since=2>; rel="first"`},
2158 },
2159 }
2160
2161 response = newResponse(&r)
2162 if got, want := response.FirstPage, 0; got != want {
2163 t.Errorf("response.FirstPage: %v, want %v", got, want)
2164 }
2165}
2166
2167func TestDo(t *testing.T) {
2168 t.Parallel()

Callers

nothing calls this directly

Calls 1

newResponseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…