diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-21 09:18:34 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-21 09:18:34 +0000 |
| commit | c814ec80c7d06c14f4b38f6c537ef186a92d73e3 (patch) | |
| tree | 190b49f514b59163a44d62dccdaec4f0cc89176b /test/zlib | |
| parent | 02ab62312b0f0e5104db4279d1baeef1ac5fe602 (diff) | |
| download | ruby-c814ec80c7d06c14f4b38f6c537ef186a92d73e3.tar.gz ruby-c814ec80c7d06c14f4b38f6c537ef186a92d73e3.tar.xz ruby-c814ec80c7d06c14f4b38f6c537ef186a92d73e3.zip | |
* ext/zlib/zlib.c: remove obsolete prototype macros.
* ext/zlib/zlib.c (struct gzfile): add encoding field to gzfile
structure.
* ext/zlib/zlib.c (rb_gzreader_getc): now works on characters.
* ext/zlib/zlib.c (rb_gzreader_getbyte): new method to retrieve
single byte.
* ext/zlib/zlib.c (rb_gzreader_readbyte): ditto.
* ext/zlib/zlib.c (rb_gzreader_each_byte): renamed from each_char
* ext/zlib/zlib.c (rb_gzreader_ungetc): allow unget strings.
* ext/zlib/zlib.c (rb_gzreader_ungetbyte): renamed from ungetc.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/zlib')
| -rw-r--r-- | test/zlib/test_zlib.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index fe8cee562..5746f036e 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -470,10 +470,20 @@ if defined? Zlib Zlib::GzipWriter.open(t.path) {|gz| gz.print("foobar") } f = Zlib::GzipReader.open(t.path) - "foobar".each_byte {|c| assert_equal(c, f.getc) } + "foobar".each_char {|c| assert_equal(c, f.getc) } assert_nil(f.getc) end + def test_getbyte + t = Tempfile.new("test_zlib_gzip_reader") + t.close + Zlib::GzipWriter.open(t.path) {|gz| gz.print("foobar") } + + f = Zlib::GzipReader.open(t.path) + "foobar".each_byte {|c| assert_equal(c, f.getbyte) } + assert_nil(f.getbyte) + end + def test_readchar t = Tempfile.new("test_zlib_gzip_reader") t.close |
