Skip to content

Commit

Permalink
Move test suite to test/lint/streams.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
godric committed Aug 2, 2021
1 parent 5585b67 commit 2e85516
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
11 changes: 11 additions & 0 deletions test/lint/streams.rb
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,17 @@ def test_xreadgroup_with_invalid_arguments
assert_raises(Redis::CommandError) { redis.xreadgroup('g1', 'c1', 's1', %w[> >]) }
end

def test_xreadgroup_a_trimmed_entry
redis.xgroup(:create, 'k1', 'g1', '0', mkstream: true)
entry_id = redis.xadd('k1', { value: 'v1' })

assert_equal({ 'k1' => [[entry_id, { 'value' => 'v1' }]] }, redis.xreadgroup('g1', 'c1', 'k1', '>'))
assert_equal({ 'k1' => [[entry_id, { 'value' => 'v1' }]] }, redis.xreadgroup('g1', 'c1', 'k1', '0'))
redis.xtrim('k1', 0)

assert_equal({ 'k1' => [[entry_id, nil]] }, redis.xreadgroup('g1', 'c1', 'k1', '0'))
end

def test_xack_with_a_entry_id
redis.xadd('s1', { f: 'v1' }, id: '0-1')
redis.xgroup(:create, 's1', 'g1', '$')
Expand Down
18 changes: 0 additions & 18 deletions test/streams_test.rb

This file was deleted.

0 comments on commit 2e85516

Please sign in to comment.