diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/zlib/test_zlib.rb | 19 |
2 files changed, 24 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Wed Jul 4 07:05:59 2012 Eric Hodel <drbrain@segment7.net> + + * test/zlib/test_zlib.rb (test_inflate_partial_input): Added test for + inflating incomplete zlib streams. + Tue Jul 3 23:14:16 2012 Naohisa Goto <ngotogenome@gmail.com> * gc.c (ATOMIC_SIZE_EXCHANGE): fix function name on Solaris [Bug #6689] 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" |