Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v17] Define Backend.GetRange to be inclusive #51025

Merged
merged 5 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Test for Backend.GetRange being inclusive
espadolini authored and github-actions committed Jan 14, 2025
commit cd810a1f21d2d46ee5b384f90b3c94f58c01bfa2
5 changes: 5 additions & 0 deletions lib/backend/test/suite.go
Original file line number Diff line number Diff line change
@@ -331,6 +331,11 @@ func testQueryRange(t *testing.T, newBackend Constructor) {
require.NoError(t, err)
RequireItems(t, []backend.Item{c1, c2}, result.Items)

// item at the end of the range
result, err = uut.GetRange(ctx, prefix("prefix", "c", "c1"), prefix("prefix", "c", "c2"), backend.NoLimit)
require.NoError(t, err)
RequireItems(t, []backend.Item{c1, c2}, result.Items)

// pagination
result, err = uut.GetRange(ctx, prefix("prefix"), backend.RangeEnd(prefix("prefix")), 2)
require.NoError(t, err)