File: expiring_hash_api_set_builder_test.go

package info (click to toggle)
gitlab-agent 16.11.5-1
  • links: PTS, VCS
  • area: contrib
  • in suites: experimental
  • size: 7,072 kB
  • sloc: makefile: 193; sh: 55; ruby: 3
file content (27 lines) | stat: -rw-r--r-- 540 bytes parent folder | download
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")
}