(t *testing.T)
| 2047 | } |
| 2048 | |
| 2049 | func TestResponse_beforeAfterPagination(t *testing.T) { |
| 2050 | t.Parallel() |
| 2051 | r := http.Response{ |
| 2052 | Header: http.Header{ |
| 2053 | "Link": { |
| 2054 | `<https://api.github.com/?after=a1b2c3&before=>; rel="next",` + |
| 2055 | ` <https://api.github.com/?after=&before=>; rel="first",` + |
| 2056 | ` <https://api.github.com/?after=&before=d4e5f6>; rel="prev",`, |
| 2057 | }, |
| 2058 | }, |
| 2059 | } |
| 2060 | |
| 2061 | response := newResponse(&r) |
| 2062 | if got, want := response.Before, "d4e5f6"; got != want { |
| 2063 | t.Errorf("response.Before: %v, want %v", got, want) |
| 2064 | } |
| 2065 | if got, want := response.After, "a1b2c3"; got != want { |
| 2066 | t.Errorf("response.After: %v, want %v", got, want) |
| 2067 | } |
| 2068 | if got, want := response.FirstPage, 0; got != want { |
| 2069 | t.Errorf("response.FirstPage: %v, want %v", got, want) |
| 2070 | } |
| 2071 | if got, want := response.PrevPage, 0; want != got { |
| 2072 | t.Errorf("response.PrevPage: %v, want %v", got, want) |
| 2073 | } |
| 2074 | if got, want := response.NextPage, 0; want != got { |
| 2075 | t.Errorf("response.NextPage: %v, want %v", got, want) |
| 2076 | } |
| 2077 | if got, want := response.LastPage, 0; want != got { |
| 2078 | t.Errorf("response.LastPage: %v, want %v", got, want) |
| 2079 | } |
| 2080 | if got, want := response.NextPageToken, ""; want != got { |
| 2081 | t.Errorf("response.NextPageToken: %v, want %v", got, want) |
| 2082 | } |
| 2083 | } |
| 2084 | |
| 2085 | func TestResponse_populatePageValues_invalid(t *testing.T) { |
| 2086 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…