Skip to content

Commit 94879db

Browse files
committed
chore(mongox): remove comments
1 parent e67ae6c commit 94879db

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

mongox/pagination_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,15 @@ func TestClientCollection_Paginate(t *testing.T) {
1616
initDB := mongotest.Connect(t)
1717
c := NewCollection(initDB(t).Collection("test"))
1818

19-
// seeds
2019
seeds := []string{"a", "b", "c"}
2120
_, _ = c.Client().InsertMany(ctx, lo.Map(seeds, func(s string, i int) any {
2221
return bson.M{"id": s, "i": len(seeds) - i}
2322
}))
2423

25-
// nil
2624
got, goterr := c.Paginate(ctx, nil, nil, nil, nil)
2725
assert.Nil(t, got)
2826
assert.NoError(t, goterr)
2927

30-
// cursor: first
3128
p := usecasex.CursorPagination{
3229
First: lo.ToPtr(int64(1)),
3330
}
@@ -44,7 +41,6 @@ func TestClientCollection_Paginate(t *testing.T) {
4441
assert.NoError(t, goterr)
4542
assert.Equal(t, []usecasex.Cursor{"a"}, con.Cursors)
4643

47-
// cursor: first, after
4844
p = usecasex.CursorPagination{
4945
First: lo.ToPtr(int64(1)),
5046
After: usecasex.Cursor("b").Ref(),
@@ -62,7 +58,6 @@ func TestClientCollection_Paginate(t *testing.T) {
6258
assert.NoError(t, goterr)
6359
assert.Equal(t, []usecasex.Cursor{"c"}, con.Cursors)
6460

65-
// cursor: last
6661
p = usecasex.CursorPagination{
6762
Last: lo.ToPtr(int64(1)),
6863
}
@@ -79,7 +74,6 @@ func TestClientCollection_Paginate(t *testing.T) {
7974
assert.NoError(t, goterr)
8075
assert.Equal(t, []usecasex.Cursor{"c"}, con.Cursors)
8176

82-
// cursor: last, before
8377
p = usecasex.CursorPagination{
8478
Last: lo.ToPtr(int64(1)),
8579
Before: usecasex.Cursor("b").Ref(),
@@ -97,7 +91,6 @@ func TestClientCollection_Paginate(t *testing.T) {
9791
assert.NoError(t, goterr)
9892
assert.Equal(t, []usecasex.Cursor{"a"}, con.Cursors)
9993

100-
// cursor: offset
10194
op := usecasex.OffsetPagination{
10295
Offset: int64(1),
10396
Limit: int64(2),
@@ -115,7 +108,6 @@ func TestClientCollection_Paginate(t *testing.T) {
115108
assert.NoError(t, goterr)
116109
assert.Equal(t, []usecasex.Cursor{"b", "c"}, con.Cursors)
117110

118-
// cursor: offset, sort
119111
op = usecasex.OffsetPagination{
120112
Offset: int64(0),
121113
Limit: int64(0),
@@ -141,18 +133,15 @@ func TestClientCollection_PaginateAggregation(t *testing.T) {
141133
initDB := mongotest.Connect(t)
142134
c := NewCollection(initDB(t).Collection("test"))
143135

144-
// seeds
145136
seeds := []string{"a", "b", "c"}
146137
_, _ = c.Client().InsertMany(ctx, lo.Map(seeds, func(s string, i int) any {
147138
return bson.M{"id": s, "i": len(seeds) - i}
148139
}))
149140

150-
// nil
151141
got, goterr := c.PaginateAggregation(ctx, nil, nil, nil, nil)
152142
assert.Nil(t, got)
153143
assert.NoError(t, goterr)
154144

155-
// cursor: first
156145
p := usecasex.CursorPagination{
157146
First: lo.ToPtr(int64(1)),
158147
}
@@ -169,7 +158,6 @@ func TestClientCollection_PaginateAggregation(t *testing.T) {
169158
assert.NoError(t, goterr)
170159
assert.Equal(t, []usecasex.Cursor{"a"}, con.Cursors)
171160

172-
// cursor: first, after
173161
p = usecasex.CursorPagination{
174162
First: lo.ToPtr(int64(1)),
175163
After: usecasex.Cursor("b").Ref(),
@@ -187,7 +175,6 @@ func TestClientCollection_PaginateAggregation(t *testing.T) {
187175
assert.NoError(t, goterr)
188176
assert.Equal(t, []usecasex.Cursor{"c"}, con.Cursors)
189177

190-
// cursor: last
191178
p = usecasex.CursorPagination{
192179
Last: lo.ToPtr(int64(1)),
193180
}
@@ -204,7 +191,6 @@ func TestClientCollection_PaginateAggregation(t *testing.T) {
204191
assert.NoError(t, goterr)
205192
assert.Equal(t, []usecasex.Cursor{"c"}, con.Cursors)
206193

207-
// cursor: last, before
208194
p = usecasex.CursorPagination{
209195
Last: lo.ToPtr(int64(1)),
210196
Before: usecasex.Cursor("b").Ref(),
@@ -222,7 +208,6 @@ func TestClientCollection_PaginateAggregation(t *testing.T) {
222208
assert.NoError(t, goterr)
223209
assert.Equal(t, []usecasex.Cursor{"a"}, con.Cursors)
224210

225-
// cursor: offset
226211
op := usecasex.OffsetPagination{
227212
Offset: int64(1),
228213
Limit: int64(2),
@@ -240,7 +225,6 @@ func TestClientCollection_PaginateAggregation(t *testing.T) {
240225
assert.NoError(t, goterr)
241226
assert.Equal(t, []usecasex.Cursor{"b", "c"}, con.Cursors)
242227

243-
// cursor: offset, sort
244228
op = usecasex.OffsetPagination{
245229
Offset: int64(0),
246230
Limit: int64(0),
@@ -343,7 +327,6 @@ func TestClientCollection_DetailedPagination(t *testing.T) {
343327
initDB := mongotest.Connect(t)
344328
c := NewCollection(initDB(t).Collection("test"))
345329

346-
// Seed data
347330
seeds := []struct {
348331
id string
349332
updatedAt int64

0 commit comments

Comments
 (0)