summaryrefslogtreecommitdiff
path: root/test/zlib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-02-02 20:59:04 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-02-10 12:49:16 +0900
commit231f0f6f45336ec9fff167d00f87b0f53bd01be7 (patch)
treeee109905951c726e7df257ec75246bd02a97180a /test/zlib
parent49d3830f44031174ad450a0ea1cdcdf0eabf9d0e (diff)
[ruby/zlib] test-unit didn't provide __name__ attribute
https://github.com/ruby/zlib/commit/7d3fc1f325
Diffstat (limited to 'test/zlib')
-rw-r--r--test/zlib/test_zlib.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb
index e6d61ca..126fc48 100644
--- a/test/zlib/test_zlib.rb
+++ b/test/zlib/test_zlib.rb
@@ -1278,11 +1278,20 @@ if defined? Zlib
end
def test_inflate
- TestZlibInflate.new(__name__).test_inflate
+ s = Zlib::Deflate.deflate("foo")
+ z = Zlib::Inflate.new
+ s = z.inflate(s)
+ s << z.inflate(nil)
+ assert_equal("foo", s)
+ z.inflate("foo") # ???
+ z << "foo" # ???
end
def test_deflate
- TestZlibDeflate.new(__name__).test_deflate
+ s = Zlib::Deflate.deflate("foo")
+ assert_equal("foo", Zlib::Inflate.inflate(s))
+
+ assert_raise(Zlib::StreamError) { Zlib::Deflate.deflate("foo", 10000) }
end
def test_deflate_stream