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

Function TestResponse_populateSinceValues

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

Source from the content-addressed store, hash-verified

1944}
1945
1946func 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
1977func TestResponse_SinceWithPage(t *testing.T) {
1978 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…