mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/zlib/test_zlib.rb: add a test for Zlib::Deflate#params.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7a89495beb
commit
dfd0d6a5ca
2 changed files with 12 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
Fri Jul 11 23:05:40 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* test/zlib/test_zlib.rb: add a test for Zlib::Deflate#params.
|
||||
|
||||
Fri Jul 11 22:58:28 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* ext/zlib/zlib.c (rb_deflate_params): flush before deflateParams.
|
||||
|
|
|
@ -120,6 +120,14 @@ if defined? Zlib
|
|||
s = z.finish
|
||||
assert_equal("foobar", Zlib::Inflate.inflate(s))
|
||||
|
||||
data = ('a'..'z').to_a.join
|
||||
z = Zlib::Deflate.new(Zlib::NO_COMPRESSION, Zlib::MAX_WBITS,
|
||||
Zlib::DEF_MEM_LEVEL, Zlib::DEFAULT_STRATEGY)
|
||||
z << data[0, 10]
|
||||
z.params(Zlib::BEST_COMPRESSION, Zlib::DEFAULT_STRATEGY)
|
||||
z << data[10 .. -1]
|
||||
assert_equal(data, Zlib::Inflate.inflate(z.finish))
|
||||
|
||||
z = Zlib::Deflate.new
|
||||
s = z.deflate("foo", Zlib::FULL_FLUSH)
|
||||
z.avail_out = 0
|
||||
|
|
Loading…
Reference in a new issue