(t *testing.T)
| 1913 | } |
| 1914 | |
| 1915 | func TestResponse_populatePageValues(t *testing.T) { |
| 1916 | t.Parallel() |
| 1917 | r := http.Response{ |
| 1918 | Header: http.Header{ |
| 1919 | "Link": { |
| 1920 | `<https://api.github.com/?page=1>; rel="first",` + |
| 1921 | ` <https://api.github.com/?page=2>; rel="prev",` + |
| 1922 | ` <https://api.github.com/?page=4>; rel="next",` + |
| 1923 | ` <https://api.github.com/?page=5>; rel="last"`, |
| 1924 | }, |
| 1925 | }, |
| 1926 | } |
| 1927 | |
| 1928 | response := newResponse(&r) |
| 1929 | if got, want := response.FirstPage, 1; got != want { |
| 1930 | t.Errorf("response.FirstPage: %v, want %v", got, want) |
| 1931 | } |
| 1932 | if got, want := response.PrevPage, 2; want != got { |
| 1933 | t.Errorf("response.PrevPage: %v, want %v", got, want) |
| 1934 | } |
| 1935 | if got, want := response.NextPage, 4; want != got { |
| 1936 | t.Errorf("response.NextPage: %v, want %v", got, want) |
| 1937 | } |
| 1938 | if got, want := response.LastPage, 5; want != got { |
| 1939 | t.Errorf("response.LastPage: %v, want %v", got, want) |
| 1940 | } |
| 1941 | if got, want := response.NextPageToken, ""; want != got { |
| 1942 | t.Errorf("response.NextPageToken: %v, want %v", got, want) |
| 1943 | } |
| 1944 | } |
| 1945 | |
| 1946 | func TestResponse_populateSinceValues(t *testing.T) { |
| 1947 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…