Skip to content

Commit 02b6ce5

Browse files
SamSaffronbyroot
authored andcommitted
Add test case covering partial writes and variable size encoding
1 parent e05f08e commit 02b6ce5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/internals_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ def test_logger
1212
assert log.string =~ /\[Redis\] call_time=\d+\.\d+ ms/
1313
end
1414

15+
def test_large_payload
16+
# see: https://github.com/redis/redis-rb/issues/962
17+
# large payloads will trigger write_nonblock to write a portion
18+
# of the payload in connection/ruby.rb _write_to_socket
19+
large = "\u3042" * 4_000_000
20+
r.setex("foo", 10, large)
21+
result = r.get("foo")
22+
assert_equal result, large
23+
end
24+
1525
def test_logger_with_pipelining
1626
r.pipelined do
1727
r.set "foo", "bar"

0 commit comments

Comments
 (0)