Exemple #1
0
func randSet(t *T, c Cmder, count int) (string, map[string]bool) {
	key := testutil.RandStr()
	fullMap := map[string]bool{}
	for i := 0; i < count; i++ {
		elem := strconv.Itoa(i)
		fullMap[elem] = true
		require.Nil(t, c.Cmd("SADD", key, elem).Err)
	}
	return key, fullMap
}
Exemple #2
0
func randPrefix(t *T, c Cmder, count int) (string, map[string]bool) {
	prefix := testutil.RandStr()
	fullMap := map[string]bool{}
	for i := 0; i < count; i++ {
		key := prefix + ":" + strconv.Itoa(i)
		fullMap[key] = true
		require.Nil(t, c.Cmd("SET", key, "1").Err)
	}
	return prefix, fullMap
}