| 122 | } |
| 123 | |
| 124 | func TestCacheConfigName(t *testing.T) { |
| 125 | tcs := []struct { |
| 126 | cfg *CacheConfig |
| 127 | expected string |
| 128 | }{ |
| 129 | { |
| 130 | cfg: &CacheConfig{ |
| 131 | Role: []cache.Role{cache.RoleBloom}, |
| 132 | }, |
| 133 | expected: "bloom", |
| 134 | }, |
| 135 | { |
| 136 | cfg: &CacheConfig{ |
| 137 | Role: []cache.Role{cache.RoleBloom, cache.RoleParquetColumnIdx}, |
| 138 | }, |
| 139 | expected: "bloom|parquet-column-idx", |
| 140 | }, |
| 141 | { |
| 142 | cfg: &CacheConfig{}, |
| 143 | expected: "", |
| 144 | }, |
| 145 | } |
| 146 | |
| 147 | for _, tc := range tcs { |
| 148 | actual := tc.cfg.Name() |
| 149 | require.Equal(t, tc.expected, actual) |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | func TestMaxItemSize(t *testing.T) { |
| 154 | tcs := []struct { |