Skip to content

Commit

Permalink
Stream Test Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanc-n committed Oct 2, 2024
1 parent a5cdd73 commit 534def2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tests/gocase/unit/type/stream/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1017,26 +1017,28 @@ func TestStreamOffset(t *testing.T) {
})

t.Run("XREADGROUP with empty streams returns empty arrays", func(t *testing.T) {
ctx := context.Background()
require.NoError(t, rdb.FlushAll(ctx).Err())
streamName := "test-stream-empty1"
streamName2 := "test-stream-empty2"
groupName := "test-group-empty"
consumerName := "test-consumer-empty"

require.NoError(t, rdb.XGroupCreateMkStream(ctx, "stream1", "group", "0").Err())
require.NoError(t, rdb.XGroupCreateMkStream(ctx, "stream2", "group", "0").Err())
require.NoError(t, rdb.XGroupCreateMkStream(ctx, streamName, groupName, "0").Err())
require.NoError(t, rdb.XGroupCreateMkStream(ctx, streamName2, groupName, "0").Err())

res, err := rdb.XReadGroup(ctx, &redis.XReadGroupArgs{
Group: "group",
Consumer: "consumer",
Streams: []string{"stream1", "stream2", "0", "0"},
Group: groupName,
Consumer: consumerName,
Streams: []string{streamName, streamName2, "0", "0"},
}).Result()
require.NoError(t, err)

expectedRes := []redis.XStream{
{
Stream: "stream1",
Stream: streamName,
Messages: []redis.XMessage{},
},
{
Stream: "stream2",
Stream: streamName2,
Messages: []redis.XMessage{},
},
}
Expand Down

0 comments on commit 534def2

Please sign in to comment.