Skip to content

Commit

Permalink
test-unit didn't provide __name__ attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Feb 2, 2021
1 parent 8602abb commit 7d3fc1f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/zlib/test_zlib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1276,11 +1276,20 @@ def test_crc_table
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
Expand Down

0 comments on commit 7d3fc1f

Please sign in to comment.