зеркало из https://github.com/github/ruby.git
Open gzip file in binary mode
This commit is contained in:
Родитель
583f364f71
Коммит
d05a268adc
|
@ -516,14 +516,14 @@ if defined? Zlib
|
||||||
gz.close
|
gz.close
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
t = File.open(t.path)
|
t = File.open(t.path, 'rb')
|
||||||
Zlib::GzipReader.zcat(t) do |str|
|
Zlib::GzipReader.zcat(t) do |str|
|
||||||
results << str
|
results << str
|
||||||
end
|
end
|
||||||
assert_equal(["foo", "bar"], results)
|
assert_equal(["foo", "bar"], results)
|
||||||
t.close
|
t.close
|
||||||
|
|
||||||
t = File.open(t.path)
|
t = File.open(t.path, 'rb')
|
||||||
assert_equal("foobar", Zlib::GzipReader.zcat(t))
|
assert_equal("foobar", Zlib::GzipReader.zcat(t))
|
||||||
t.close
|
t.close
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче