diff --git a/spec/zstd-ruby_spec.rb b/spec/zstd-ruby_spec.rb index ba39ea8..0810423 100644 --- a/spec/zstd-ruby_spec.rb +++ b/spec/zstd-ruby_spec.rb @@ -95,6 +95,17 @@ def to_str expect(Zstd.decompress(simple_compressed).force_encoding('UTF-8').hash).to eq(Zstd.decompress(streaming_compressed).force_encoding('UTF-8').hash) end + it 'shoud work with large streaming compress data' do + large_strings = Random.bytes(1<<16) + stream = Zstd::StreamingCompress.new + res = stream.compress(large_strings) + res << stream.flush + res << stream.compress(large_strings) + res << stream.compress(large_strings) + res << stream.finish + expect(Zstd.decompress(res)).to eq(large_strings * 3) + end + it 'should raise exception with unsupported object' do expect { Zstd.decompress(Object.new) }.to raise_error(TypeError) end