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

Function TestResponse_populatePageValues

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

Source from the content-addressed store, hash-verified

1913}
1914
1915func 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
1946func TestResponse_populateSinceValues(t *testing.T) {
1947 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…