Skip to content

Commit e2578be

Browse files
authored
Merge pull request #108 from nobu/loaded_zlib
Load the same loaded zlib
2 parents e59da75 + 02a29dc commit e2578be

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/zlib/test_zlib.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
begin
1010
require 'zlib'
1111
rescue LoadError
12+
else
13+
z = "/zlib.#{RbConfig::CONFIG["DLEXT"]}"
14+
LOADED_ZLIB, = $".select {|f| f.end_with?(z)}
1215
end
1316

1417
if defined? Zlib
@@ -1525,7 +1528,7 @@ def test_gunzip_encoding
15251528
end
15261529

15271530
def test_gunzip_no_memory_leak
1528-
assert_no_memory_leak(%[-rzlib], "#{<<~"{#"}", "#{<<~'};'}")
1531+
assert_no_memory_leak(%W[-r#{LOADED_ZLIB}], "#{<<~"{#"}", "#{<<~'};'}")
15291532
d = Zlib.gzip("data")
15301533
{#
15311534
10_000.times {Zlib.gunzip(d)}

0 commit comments

Comments
 (0)