summaryrefslogtreecommitdiff
path: root/test/zlib
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-24 02:06:32 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-24 02:06:32 +0000
commit052c0e67d99552aeb2091d1ae7133465a5aa7291 (patch)
treef7bb54920e8bad79a2ddc100c900da9b6cc4c2ad /test/zlib
parent61f50e317e3bfea90cf1b8e9ce8e4e6f704173a4 (diff)
* test/ruby/test_require.rb: Remove temporally files in the tests.
* test/ruby/test_rubyoptions.rb: Ditto. * test/logger/test_logger.rb: Ditto. * test/psych/test_psych.rb: Ditto. * test/readline/test_readline.rb: Ditto. * test/syslog/test_syslog_logger.rb: Ditto. * test/webrick/test_httpauth.rb: Ditto. * test/zlib/test_zlib.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/zlib')
-rw-r--r--test/zlib/test_zlib.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb
index aa34863..4849396 100644
--- a/test/zlib/test_zlib.rb
+++ b/test/zlib/test_zlib.rb
@@ -439,6 +439,7 @@ if defined? Zlib
Zlib::GzipReader.open(t.path) do |f|
assert_kind_of(IO, f.to_io)
end
+ t.close(true)
end
def test_crc
@@ -450,6 +451,7 @@ if defined? Zlib
f.read
assert_equal(0x8c736521, f.crc)
end
+ t.close(true)
end
def test_mtime
@@ -468,6 +470,7 @@ if defined? Zlib
Zlib::GzipReader.open(t.path) do |f|
assert_equal(tim.to_i, f.mtime.to_i)
end
+ t.close(true)
end
def test_level
@@ -478,6 +481,7 @@ if defined? Zlib
Zlib::GzipReader.open(t.path) do |f|
assert_equal(Zlib::DEFAULT_COMPRESSION, f.level)
end
+ t.close(true)
end
def test_os_code
@@ -488,6 +492,7 @@ if defined? Zlib
Zlib::GzipReader.open(t.path) do |f|
assert_equal(Zlib::OS_CODE, f.os_code)
end
+ t.close(true)
end
def test_orig_name
@@ -503,6 +508,7 @@ if defined? Zlib
Zlib::GzipReader.open(t.path) do |f|
assert_equal("foobarbazqux", f.orig_name)
end
+ t.close(true)
end
def test_comment
@@ -518,6 +524,7 @@ if defined? Zlib
Zlib::GzipReader.open(t.path) do |f|
assert_equal("foobarbazqux", f.comment)
end
+ t.close(true)
end
def test_lineno
@@ -532,6 +539,7 @@ if defined? Zlib
assert_equal([1000, "baz\n"], [f.lineno, f.gets])
assert_equal([1001, "qux\n"], [f.lineno, f.gets])
end
+ t.close(true)
end
def test_closed_p
@@ -546,6 +554,7 @@ if defined? Zlib
f.close
assert_equal(true, f.closed?)
end
+ t.close(true)
end
def test_sync
@@ -560,6 +569,7 @@ if defined? Zlib
f.sync = false
assert_equal(false, f.sync)
end
+ t.close(true)
end
def test_pos
@@ -570,6 +580,7 @@ if defined? Zlib
gz.flush
assert_equal(3, gz.tell)
end
+ t.close(true)
end
def test_path
@@ -599,6 +610,7 @@ if defined? Zlib
Zlib::GzipReader.new(sio) do |f|
assert_raise(NoMethodError) { f.path }
end
+ t.close(true)
end
end
@@ -670,6 +682,7 @@ if defined? Zlib
ensure
f.close
end
+ t.close(true)
end
def test_rewind
@@ -682,6 +695,7 @@ if defined? Zlib
f.rewind
assert_equal("foo", f.read)
end
+ t.close(true)
end
def test_unused
@@ -696,6 +710,7 @@ if defined? Zlib
assert_equal("bar", f.read)
assert_equal(nil, f.unused)
end
+ t.close(true)
end
def test_unused2
@@ -735,6 +750,7 @@ if defined? Zlib
assert_raise(ArgumentError) { f.read(-1) }
assert_equal(str, f.read)
end
+ t.close(true)
end
def test_readpartial
@@ -753,6 +769,7 @@ if defined? Zlib
assert_raise(ArgumentError) { f.readpartial(-1) }
end
+ t.close(true)
end
def test_getc
@@ -764,6 +781,7 @@ if defined? Zlib
"foobar".each_char {|c| assert_equal(c, f.getc) }
assert_nil(f.getc)
end
+ t.close(true)
end
def test_getbyte
@@ -775,6 +793,7 @@ if defined? Zlib
"foobar".each_byte {|c| assert_equal(c, f.getbyte) }
assert_nil(f.getbyte)
end
+ t.close(true)
end
def test_readchar
@@ -786,6 +805,7 @@ if defined? Zlib
"foobar".each_byte {|c| assert_equal(c, f.readchar.ord) }
assert_raise(EOFError) { f.readchar }
end
+ t.close(true)
end
def test_each_byte
@@ -798,6 +818,7 @@ if defined? Zlib
f.each_byte {|c| a << c }
assert_equal("foobar".each_byte.to_a, a)
end
+ t.close(true)
end
def test_gets
@@ -823,6 +844,7 @@ if defined? Zlib
assert_equal("az\n", f.gets(nil, 10))
assert_nil(f.gets)
end
+ t.close(true)
end
def test_gets2
@@ -849,6 +871,7 @@ if defined? Zlib
assert_equal(ustrs[2][1..-1], f.gets(nil, 20))
assert_nil(f.gets)
end
+ t.close(true)
end
def test_readline
@@ -862,6 +885,7 @@ if defined? Zlib
assert_equal("baz\n", f.readline)
assert_raise(EOFError) { f.readline }
end
+ t.close(true)
end
def test_each
@@ -873,6 +897,7 @@ if defined? Zlib
a = ["foo\n", "bar\n", "baz\n"]
f.each {|l| assert_equal(a.shift, l) }
end
+ t.close(true)
end
def test_readlines
@@ -883,6 +908,7 @@ if defined? Zlib
Zlib::GzipReader.open(t.path) do |f|
assert_equal(["foo\n", "bar\n", "baz\n"], f.readlines)
end
+ t.close(true)
end
def test_reader_wrap
@@ -893,6 +919,7 @@ if defined? Zlib
f.binmode
assert_equal("foo", Zlib::GzipReader.wrap(f) {|gz| gz.read })
assert_raise(IOError) { f.close }
+ t.close(true)
end
def test_corrupted_header
@@ -923,6 +950,7 @@ if defined? Zlib
read_size = Zlib::GzipReader.open(t.path) {|gz| gz.read(1024) }
assert_equal(Encoding::ASCII_8BIT, read_size.encoding)
assert_equal(content, read_size)
+ t.close(true)
end
end
@@ -951,6 +979,7 @@ if defined? Zlib
assert_equal("bar", Zlib::GzipReader.open(t.path) {|gz| gz.read })
assert_raise(Zlib::StreamError) { Zlib::GzipWriter.open(t.path, 10000) }
+ t.close(true)
end
def test_write
@@ -963,6 +992,7 @@ if defined? Zlib
def o.to_s; "bar"; end
Zlib::GzipWriter.open(t.path) {|gz| gz.print(o) }
assert_equal("bar", Zlib::GzipReader.open(t.path) {|gz| gz.read })
+ t.close(true)
end
def test_putc
@@ -972,6 +1002,7 @@ if defined? Zlib
assert_equal("x", Zlib::GzipReader.open(t.path) {|gz| gz.read })
# todo: multibyte char
+ t.close(true)
end
def test_writer_wrap
@@ -980,6 +1011,7 @@ if defined? Zlib
Zlib::GzipWriter.wrap(t) {|gz| gz.print("foo") }
t.close
assert_equal("foo", Zlib::GzipReader.open(t.path) {|gz| gz.read })
+ t.close(true)
end
end