Fix to set MaxID and SinceID to exclusive
This commit is contained in:
parent
9e07d8951e
commit
4033436175
3 changed files with 18 additions and 7 deletions
|
|
@ -339,10 +339,23 @@ func TestPaginationSetValues(t *testing.T) {
|
|||
if after.Get("max_id") != "123" {
|
||||
t.Fatalf("want %q but %q", "123", after.Get("max_id"))
|
||||
}
|
||||
if after.Get("since_id") != "789" {
|
||||
t.Fatalf("want %q but %q", "789", after.Get("since_id"))
|
||||
if after.Get("since_id") != "" {
|
||||
t.Fatalf("result should be empty string: %q", after.Get("since_id"))
|
||||
}
|
||||
if after.Get("limit") != "10" {
|
||||
t.Fatalf("want %q but %q", "10", after.Get("limit"))
|
||||
}
|
||||
|
||||
p = &Pagination{
|
||||
MaxID: 0,
|
||||
SinceID: 789,
|
||||
}
|
||||
before = url.Values{}
|
||||
after = p.setValues(before)
|
||||
if after.Get("max_id") != "" {
|
||||
t.Fatalf("result should be empty string: %q", after.Get("max_id"))
|
||||
}
|
||||
if after.Get("since_id") != "789" {
|
||||
t.Fatalf("want %q but %q", "789", after.Get("since_id"))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue