@@ -677,6 +677,35 @@ func TestResponse_populateSinceValues(t *testing.T) {
677677 }
678678}
679679
680+ func TestResponse_SinceWithPage (t * testing.T ) {
681+ r := http.Response {
682+ Header : http.Header {
683+ "Link" : {`<https://api.github.com/?since=2021-12-04T10%3A43%3A42Z&page=1>; rel="first",` +
684+ ` <https://api.github.com/?since=2021-12-04T10%3A43%3A42Z&page=2>; rel="prev",` +
685+ ` <https://api.github.com/?since=2021-12-04T10%3A43%3A42Z&page=4>; rel="next",` +
686+ ` <https://api.github.com/?since=2021-12-04T10%3A43%3A42Z&page=5>; rel="last"` ,
687+ },
688+ },
689+ }
690+
691+ response := newResponse (& r )
692+ if got , want := response .FirstPage , 1 ; got != want {
693+ t .Errorf ("response.FirstPage: %v, want %v" , got , want )
694+ }
695+ if got , want := response .PrevPage , 2 ; want != got {
696+ t .Errorf ("response.PrevPage: %v, want %v" , got , want )
697+ }
698+ if got , want := response .NextPage , 4 ; want != got {
699+ t .Errorf ("response.NextPage: %v, want %v" , got , want )
700+ }
701+ if got , want := response .LastPage , 5 ; want != got {
702+ t .Errorf ("response.LastPage: %v, want %v" , got , want )
703+ }
704+ if got , want := response .NextPageToken , "" ; want != got {
705+ t .Errorf ("response.NextPageToken: %v, want %v" , got , want )
706+ }
707+ }
708+
680709func TestResponse_cursorPagination (t * testing.T ) {
681710 r := http.Response {
682711 Header : http.Header {
0 commit comments