Fix TestNewPagination

Add min_id error pattern.
This commit is contained in:
178inaba 2019-02-14 23:36:14 +09:00 committed by mattn
parent 460b971f54
commit efa05aa949

View File

@ -293,6 +293,11 @@ func TestNewPagination(t *testing.T) {
t.Fatalf("should be fail: %v", err) t.Fatalf("should be fail: %v", err)
} }
_, err = newPagination(`<http://example.com?min_id=abc>; rel="prev"`)
if err == nil {
t.Fatalf("should be fail: %v", err)
}
pg, err := newPagination(`<http://example.com?max_id=123>; rel="next", <http://example.com?since_id=789>; rel="prev"`) pg, err := newPagination(`<http://example.com?max_id=123>; rel="next", <http://example.com?since_id=789>; rel="prev"`)
if err != nil { if err != nil {
t.Fatalf("should not be fail: %v", err) t.Fatalf("should not be fail: %v", err)