From 03b2b5e2bed08cdaa0090c393cba49678e6fff49 Mon Sep 17 00:00:00 2001 From: Nabarun Date: Thu, 11 Dec 2025 17:59:48 +0530 Subject: [PATCH] test: add assertion for collection filtered with pagination offset --- types/query/collections_pagination_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/types/query/collections_pagination_test.go b/types/query/collections_pagination_test.go index 87cfc549a9..fc2f905823 100644 --- a/types/query/collections_pagination_test.go +++ b/types/query/collections_pagination_test.go @@ -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,