Skip to content

Commit a4b7e69

Browse files
author
kuba--
committed
Add TestPartitionRowsWithIndex
Signed-off-by: kuba-- <[email protected]>
1 parent 4fb3421 commit a4b7e69

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

commit_files_test.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,36 @@ func TestCommitFilesIndexIterClosed(t *testing.T) {
106106
func TestCommitFilesIterClosed(t *testing.T) {
107107
testTableIterClosed(t, new(commitFilesTable))
108108
}
109+
110+
func TestPartitionRowsWithIndex(t *testing.T) {
111+
112+
t.Helper()
113+
require := require.New(t)
114+
ctx, _, cleanup := setup(t)
115+
defer cleanup()
116+
117+
table := new(commitFilesTable)
118+
expected, err := tableToRows(ctx, table)
119+
require.NoError(err)
120+
121+
lookup := tableIndexLookup(t, table, ctx)
122+
tbl := table.WithIndexLookup(lookup)
123+
124+
pit, err := tbl.Partitions(ctx)
125+
require.NoError(err)
126+
127+
i := 0
128+
for p, e := pit.Next(); e != io.EOF; p, e = pit.Next() {
129+
require.NoError(e)
130+
131+
rit, err := tbl.PartitionRows(ctx, p)
132+
require.NoError(err)
133+
134+
for r, e := rit.Next(); e != io.EOF; r, e = rit.Next() {
135+
require.NoError(e)
136+
137+
require.ElementsMatch(expected[i], r)
138+
i++
139+
}
140+
}
141+
}

0 commit comments

Comments
 (0)