Skip to content

Commit

Permalink
generic
Browse files Browse the repository at this point in the history
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
  • Loading branch information
mathetake committed Sep 17, 2024
1 parent 7e9c309 commit 0f5e0fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/descriptor/export_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package descriptor

// Masks returns the masks of the table for testing purposes.
func (t *Table[int32, string]) Masks() []uint64 {
func Masks[Key ~int32, Item any](t *Table[Key, Item]) []uint64 {
return t.masks
}

// Items returns the items of the table for testing purposes.
func (t *Table[int32, string]) Items() []string {
func Items[Key ~int32, Item any](t *Table[Key, Item]) []Item {
return t.items
}
4 changes: 2 additions & 2 deletions internal/descriptor/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ func Test_sizeOfTable(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
table := new(descriptor.Table[int32, string])
tc.operation(table)
require.Equal(t, tc.expectedSize, len(table.Masks()))
require.Equal(t, tc.expectedSize*64, len(table.Items()))
require.Equal(t, tc.expectedSize, len(descriptor.Masks(table)))
require.Equal(t, tc.expectedSize*64, len(descriptor.Items(table)))
})
}
}

0 comments on commit 0f5e0fe

Please sign in to comment.