diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-03 22:08:04 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-03 22:08:04 +0000 |
commit | 0e9b0c8c84e08bdb7a8308dfdafee2346ad9995e (patch) | |
tree | 1e69b731b9477a49098d0cebbf624a54442faacb /test | |
parent | 98cbc7070da28a544b68e6b9b311b90978c14e05 (diff) | |
download | ruby-0e9b0c8c84e08bdb7a8308dfdafee2346ad9995e.tar.gz |
* test/zlib/test_zlib.rb (test_inflate_partial_input): Added test for
inflating incomplete zlib streams.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/zlib/test_zlib.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index 699b65a5f4..61e24e4d44 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -212,6 +212,25 @@ if defined? Zlib z << "foo" # ??? end + def test_inflate_partial_input + deflated = Zlib::Deflate.deflate "\0" + + a = deflated[0...2] + b = deflated[2..-1] + + z = Zlib::Inflate.new + + inflated = "" + + deflated.each_char do |byte| + inflated << z.inflate(byte) + end + + inflated << z.finish + + assert_equal "\0", inflated + end + def test_inflate_dictionary dictionary = "foo" |