Skip to content

Commit 7d3fc1f

Browse files
committed
test-unit didn't provide __name__ attribute
1 parent 8602abb commit 7d3fc1f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/zlib/test_zlib.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,11 +1276,20 @@ def test_crc_table
12761276
end
12771277

12781278
def test_inflate
1279-
TestZlibInflate.new(__name__).test_inflate
1279+
s = Zlib::Deflate.deflate("foo")
1280+
z = Zlib::Inflate.new
1281+
s = z.inflate(s)
1282+
s << z.inflate(nil)
1283+
assert_equal("foo", s)
1284+
z.inflate("foo") # ???
1285+
z << "foo" # ???
12801286
end
12811287

12821288
def test_deflate
1283-
TestZlibDeflate.new(__name__).test_deflate
1289+
s = Zlib::Deflate.deflate("foo")
1290+
assert_equal("foo", Zlib::Inflate.inflate(s))
1291+
1292+
assert_raise(Zlib::StreamError) { Zlib::Deflate.deflate("foo", 10000) }
12841293
end
12851294

12861295
def test_deflate_stream

0 commit comments

Comments
 (0)