TestList makes sure stored keys are listed back.
(t *testing.T)
| 264 | |
| 265 | // TestList makes sure stored keys are listed back. |
| 266 | func TestList(t *testing.T) { |
| 267 | keysToCreate := []string{"a", "b", "c"} |
| 268 | |
| 269 | withFixtures(t, func(t *testing.T, client Client) { |
| 270 | for _, key := range keysToCreate { |
| 271 | err := client.CAS(context.Background(), key, func(interface{}) (out interface{}, retry bool, err error) { |
| 272 | return key, false, nil |
| 273 | }) |
| 274 | require.NoError(t, err) |
| 275 | } |
| 276 | |
| 277 | storedKeys, err := client.List(context.Background(), "") |
| 278 | require.NoError(t, err) |
| 279 | sort.Strings(storedKeys) |
| 280 | |
| 281 | require.Equal(t, keysToCreate, storedKeys) |
| 282 | }) |
| 283 | } |
nothing calls this directly
no test coverage detected