(t *testing.T)
| 1944 | } |
| 1945 | |
| 1946 | func TestResponse_populateSinceValues(t *testing.T) { |
| 1947 | t.Parallel() |
| 1948 | r := http.Response{ |
| 1949 | Header: http.Header{ |
| 1950 | "Link": { |
| 1951 | `<https://api.github.com/?since=1>; rel="first",` + |
| 1952 | ` <https://api.github.com/?since=2>; rel="prev",` + |
| 1953 | ` <https://api.github.com/?since=4>; rel="next",` + |
| 1954 | ` <https://api.github.com/?since=5>; rel="last"`, |
| 1955 | }, |
| 1956 | }, |
| 1957 | } |
| 1958 | |
| 1959 | response := newResponse(&r) |
| 1960 | if got, want := response.FirstPage, 1; got != want { |
| 1961 | t.Errorf("response.FirstPage: %v, want %v", got, want) |
| 1962 | } |
| 1963 | if got, want := response.PrevPage, 2; want != got { |
| 1964 | t.Errorf("response.PrevPage: %v, want %v", got, want) |
| 1965 | } |
| 1966 | if got, want := response.NextPage, 4; want != got { |
| 1967 | t.Errorf("response.NextPage: %v, want %v", got, want) |
| 1968 | } |
| 1969 | if got, want := response.LastPage, 5; want != got { |
| 1970 | t.Errorf("response.LastPage: %v, want %v", got, want) |
| 1971 | } |
| 1972 | if got, want := response.NextPageToken, ""; want != got { |
| 1973 | t.Errorf("response.NextPageToken: %v, want %v", got, want) |
| 1974 | } |
| 1975 | } |
| 1976 | |
| 1977 | func TestResponse_SinceWithPage(t *testing.T) { |
| 1978 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…