1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
package redistool
import (
"context"
"errors"
"testing"
"github.com/redis/rueidis"
"github.com/stretchr/testify/assert"
)
func TestDoReturnsErrorOnFailedEmptySet(t *testing.T) {
b := RedisSetBuilder[int, int]{
setErr: errors.New("boom"),
}
assert.EqualError(t, b.Do(context.Background()), "boom")
}
func TestDoReturnsErrorOnFailedNonEmptySet(t *testing.T) {
b := RedisSetBuilder[int, int]{
setErr: errors.New("boom"),
cmds: make([]rueidis.Completed, 1),
}
assert.EqualError(t, b.Do(context.Background()), "boom")
}
|