test: add assertion for collection filtered with pagination offset

This commit is contained in:
Nabarun 2025-12-11 17:59:48 +05:30
parent 9d8d03dc4a
commit aeaa57596c
Signed by: nabarun
SSH Key Fingerprint: SHA256:f1nVtP06rAVZwNB+5/iCsWPN1LrChcZYgzToiUHlOuQ

View File

@ -154,6 +154,23 @@ func TestCollectionPagination(t *testing.T) {
{Key: 295, Value: 295},
},
},
"filtered with offset": {
req: &PageRequest{
Offset: 3,
Limit: 3,
},
expResp: &PageResponse{
NextKey: encodeKey(12),
},
filter: func(key, value uint64) (bool, error) {
return key%2 == 0, nil
},
expResults: []collections.KeyValue[uint64, uint64]{
{Key: 6, Value: 6},
{Key: 8, Value: 8},
{Key: 10, Value: 10},
},
},
"filtered no key with error": {
req: &PageRequest{
Limit: 3,