Skip to content

Commit

Permalink
Test redis.Streams#Option()
Browse files Browse the repository at this point in the history
  • Loading branch information
Al2Klimov committed Sep 17, 2024
1 parent 715b56e commit 8888b38
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions redis/streams_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package redis

import (
"github.com/stretchr/testify/require"
"testing"
)

func TestStreams_Option(t *testing.T) {
subtests := []struct {
name string
input Streams
output []string
}{
{"nil", nil, []string{}},
{"empty", Streams{}, []string{}},
{"one", Streams{"key": "id"}, []string{"key", "id"}},
{"two", Streams{"key1": "id1", "key2": "id2"}, []string{"key1", "key2", "id1", "id2"}},
}

for _, st := range subtests {
t.Run(st.name, func(t *testing.T) {
require.Equal(t, st.output, st.input.Option())
})
}
}

0 comments on commit 8888b38

Please sign in to comment.