Skip to content

Commit 07e52c8

Browse files
committed
Fix TestSocket#test_bintime
`String#unpack` does not allow negative offset.
1 parent 81df2bd commit 07e52c8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

test/socket/test_socket.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,8 @@ def test_bintime
548548
timestamp_retry_rw(s1, :BINTIME)
549549
}
550550
t = stamp.timestamp
551-
assert_equal(stamp.data.unpack1("Q", offset: -8), t.subsec * 2**64)
551+
data = stamp.data
552+
assert_equal(data.unpack1("Q", offset: data.bytesize-8), t.subsec * 2**64)
552553
end
553554

554555
def test_closed_read

0 commit comments

Comments
 (0)