8000 Add compatibility test for Zip::InputStream#read(0) · rubyzip/rubyzip@a4f9ec6 · GitHub
[go: up one dir, main page]

Skip to content

Commit a4f9ec6

Browse files
sakurohainesr
authored andcommitted
Add compatibility test for Zip::InputStream#read(0)
1 parent 3ce504f commit a4f9ec6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/input_stream_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ def test_read_with_number_of_bytes_returns_nil_at_eof
189189
end
190190
end
191191

192+
def test_read_with_zero_returns_empty_string
193+
::Zip::InputStream.open(TestZipFile::TEST_ZIP2.zip_name) do |zis|
194+
assert_equal('', zis.read(0))
195+
end
196+
end
197+
192198
def test_rewind
193199
::Zip::InputStream.open(TestZipFile::TEST_ZIP2.zip_name) do |zis|
194200
e = zis.get_next_entry

0 commit comments

Comments
 (0)
0