From 68543f30921c52cb1bf5c041879a232b41ba6580 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 18 Nov 2007 07:18:56 +0000 Subject: use ML ref. for assertion message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/fileutils/test_fileutils.rb | 3 +-- test/io/nonblock/test_flush.rb | 4 ++-- test/ruby/test_beginendblock.rb | 5 ++--- test/ruby/test_bignum.rb | 14 +++++++------- test/ruby/test_eval.rb | 16 ++++++++-------- test/ruby/test_file.rb | 11 +++++------ test/ruby/test_fnmatch.rb | 5 ++--- test/ruby/test_integer.rb | 9 ++++----- test/ruby/test_io.rb | 6 +++--- test/ruby/test_path.rb | 10 +++++----- test/ruby/test_proc.rb | 12 ++++-------- test/ruby/test_sprintf.rb | 27 +++++++++++---------------- test/ruby/test_super.rb | 4 ++-- test/ruby/test_system.rb | 4 ++-- test/ruby/test_time.rb | 6 +++--- test/socket/test_socket.rb | 4 ++-- test/socket/test_tcp.rb | 4 ++-- test/socket/test_udp.rb | 8 ++++---- test/stringio/test_stringio.rb | 12 ++++++------ test/uri/test_common.rb | 5 ++--- test/uri/test_generic.rb | 20 +++++++------------- test/zlib/test_zlib.rb | 18 ++++++++---------- 22 files changed, 92 insertions(+), 115 deletions(-) (limited to 'test') diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 47c7ae63c6..3826d9b28e 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -326,14 +326,13 @@ end assert_same_file fname, 'tmp/mvdest' end - # [ruby-talk:124368] mkdir 'tmp/tmpdir' mkdir_p 'tmp/dest2/tmpdir' assert_raises(Errno::EEXIST) { mv 'tmp/tmpdir', 'tmp/dest2' } mkdir 'tmp/dest2/tmpdir/junk' - assert_raises(Errno::EEXIST) { + assert_raises(Errno::EEXIST, "[ruby-talk:124368]") { mv 'tmp/tmpdir', 'tmp/dest2' } diff --git a/test/io/nonblock/test_flush.rb b/test/io/nonblock/test_flush.rb index e3dca072d7..6301be211a 100644 --- a/test/io/nonblock/test_flush.rb +++ b/test/io/nonblock/test_flush.rb @@ -6,7 +6,7 @@ end Thread.abort_on_exception = true class TestIONonblock < Test::Unit::TestCase - def test_flush # [ruby-dev:24985] + def test_flush flunk "IO#close can't interrupt IO blocking on YARV" r,w = IO.pipe w.nonblock = true @@ -24,7 +24,7 @@ class TestIONonblock < Test::Unit::TestCase result << s end } - assert_raise(IOError) {w.flush} + assert_raise(IOError, "[ruby-dev:24985]") {w.flush} assert_nothing_raised {t.join} assert_equal(4097, result.size) end diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb index 6d077ba08a..e5f21286a0 100644 --- a/test/ruby/test_beginendblock.rb +++ b/test/ruby/test_beginendblock.rb @@ -54,15 +54,14 @@ EOW end def test_raise_in_at_exit - # [ruby-core:09675] ruby = EnvUtil.rubybin out = IO.popen([ruby, '-e', 'STDERR.reopen(STDOUT)', '-e', 'at_exit{raise %[SomethingBad]}', '-e', 'raise %[SomethingElse]']) {|f| f.read } - assert_match /SomethingBad/, out - assert_match /SomethingElse/, out + assert_match /SomethingBad/, out, "[ruby-core:9675]" + assert_match /SomethingElse/, out, "[ruby-core:9675]" end def test_should_propagate_exit_code diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index 48e8d9a92c..a264d1cf63 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -85,13 +85,13 @@ class TestBignum < Test::Unit::TestCase shift_test(-0xfffffffffffffffff) end - def test_to_s # [ruby-core:10686] - assert_equal("fvvvvvvvvvvvv" ,18446744073709551615.to_s(32)) - assert_equal("g000000000000" ,18446744073709551616.to_s(32)) - assert_equal("3w5e11264sgsf" ,18446744073709551615.to_s(36)) - assert_equal("3w5e11264sgsg" ,18446744073709551616.to_s(36)) - assert_equal("nd075ib45k86f" ,18446744073709551615.to_s(31)) - assert_equal("nd075ib45k86g" ,18446744073709551616.to_s(31)) + def test_to_s + assert_equal("fvvvvvvvvvvvv" ,18446744073709551615.to_s(32), "[ruby-core:10686]") + assert_equal("g000000000000" ,18446744073709551616.to_s(32), "[ruby-core:10686]") + assert_equal("3w5e11264sgsf" ,18446744073709551615.to_s(36), "[ruby-core:10686]") + assert_equal("3w5e11264sgsg" ,18446744073709551616.to_s(36), "[ruby-core:10686]") + assert_equal("nd075ib45k86f" ,18446744073709551615.to_s(31), "[ruby-core:10686]") + assert_equal("nd075ib45k86g" ,18446744073709551616.to_s(31), "[ruby-core:10686]") assert_equal("1777777777777777777777" ,18446744073709551615.to_s(8)) assert_equal("-1777777777777777777777" ,-18446744073709551615.to_s(8)) end diff --git a/test/ruby/test_eval.rb b/test/ruby/test_eval.rb index 281548b096..7e6313b133 100644 --- a/test/ruby/test_eval.rb +++ b/test/ruby/test_eval.rb @@ -338,30 +338,30 @@ class TestEval < Test::Unit::TestCase end end - def test_nil_instance_eval_cvar # [ruby-dev:24103] + def test_nil_instance_eval_cvar def nil.test_binding binding end bb = eval("nil.instance_eval \"binding\"", nil.test_binding) - assert_raise(NameError) { eval("@@a", bb) } + assert_raise(NameError, "[ruby-dev:24103]") { eval("@@a", bb) } class << nil remove_method :test_binding end end - def test_fixnum_instance_eval_cvar # [ruby-dev:24213] - assert_raise(NameError) { 1.instance_eval "@@a" } + def test_fixnum_instance_eval_cvar + assert_raise(NameError, "[ruby-dev:24213]") { 1.instance_eval "@@a" } end - def test_cvar_scope_with_instance_eval # [ruby-dev:24223] + def test_cvar_scope_with_instance_eval Fixnum.class_eval "@@test_cvar_scope_with_instance_eval = 1" # depends on [ruby-dev:24229] @@test_cvar_scope_with_instance_eval = 4 - assert_equal(4, 1.instance_eval("@@test_cvar_scope_with_instance_eval")) + assert_equal(4, 1.instance_eval("@@test_cvar_scope_with_instance_eval"), "[ruby-dev:24223]") Fixnum.__send__(:remove_class_variable, :@@test_cvar_scope_with_instance_eval) end - def test_eval_and_define_method # [ruby-dev:24228] - assert_nothing_raised { + def test_eval_and_define_method + assert_nothing_raised("[ruby-dev:24228]") { def temporally_method_for_test_eval_and_define_method(&block) lambda { class << Object.new; self end.send(:define_method, :zzz, &block) diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index 46163fb8f7..9119575797 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -37,16 +37,16 @@ class TestFile < Test::Unit::TestCase include TestEOF::Seek - def test_truncate_wbuf # [ruby-dev:24191] + def test_truncate_wbuf f = Tempfile.new("test-truncate") f.print "abc" f.truncate(0) f.print "def" f.close - assert_equal("\0\0\0def", File.read(f.path)) + assert_equal("\0\0\0def", File.read(f.path), "[ruby-dev:24191]") end - def test_truncate_rbuf # [ruby-dev:24197] + def test_truncate_rbuf f = Tempfile.new("test-truncate") f.puts "abc" f.puts "def" @@ -54,7 +54,7 @@ class TestFile < Test::Unit::TestCase f.open assert_equal("abc\n", f.gets) f.truncate(3) - assert_equal(nil, f.gets) + assert_equal(nil, f.gets, "[ruby-dev:24197]") end def test_truncate_beyond_eof @@ -110,8 +110,7 @@ class TestFile < Test::Unit::TestCase assert_nothing_raised { File.open(__FILE__) {|f| f.chown -1, -1 } } - # [ruby-dev:27140] - assert_nothing_raised { + assert_nothing_raised("[ruby-dev:27140]") { File.open(__FILE__) {|f| f.chown nil, nil } } end diff --git a/test/ruby/test_fnmatch.rb b/test/ruby/test_fnmatch.rb index aad848d09f..1c1a158477 100644 --- a/test/ruby/test_fnmatch.rb +++ b/test/ruby/test_fnmatch.rb @@ -10,9 +10,8 @@ class TestFnmatch < Test::Unit::TestCase end end def test_fnmatch - # from [ruby-dev:22815] and [ruby-dev:22819] - assert(File.fnmatch('\[1\]' , '[1]')) - assert(File.fnmatch('*?', 'a')) + assert(File.fnmatch('\[1\]' , '[1]'), "[ruby-dev:22819]") + assert(File.fnmatch('*?', 'a'), "[ruby-dev:22815]") assert(File.fnmatch('*/', 'a/')) assert(File.fnmatch('\[1\]' , '[1]', File::FNM_PATHNAME)) assert(File.fnmatch('*?', 'a', File::FNM_PATHNAME)) diff --git a/test/ruby/test_integer.rb b/test/ruby/test_integer.rb index cf514f5992..37f83a0acd 100644 --- a/test/ruby/test_integer.rb +++ b/test/ruby/test_integer.rb @@ -156,12 +156,11 @@ class TestInteger < Test::Unit::TestCase } } - # [ruby-dev:31271] - # assert_equal(1, (1 << 0x40000000)[0x40000000]) - # assert_equal(0, (-1 << 0x40000001)[0x40000000]) + # assert_equal(1, (1 << 0x40000000)[0x40000000], "[ruby-dev:31271]") + # assert_equal(0, (-1 << 0x40000001)[0x40000000], "[ruby-dev:31271]") big_zero = 0x40000000.coerce(0)[0] - assert_equal(0, (-0x40000002)[big_zero]) - assert_equal(1, 0x400000001[big_zero]) + assert_equal(0, (-0x40000002)[big_zero], "[ruby-dev:31271]") + assert_equal(1, 0x400000001[big_zero], "[ruby-dev:31271]") end def test_plus diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 7da6535edf..4d4f48d436 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -19,18 +19,18 @@ class TestIO < Test::Unit::TestCase assert_nil r.gets("") r.close - # "\377" [ruby-dev:24460] + # "\377" r, w = IO.pipe w.print "\377xyz" w.close assert_equal("\377", r.gets("\377"), "[ruby-dev:24460]") r.close - # "" [ruby-core:03771] + # "" r, w = IO.pipe w.print "a\n\nb\n\n" w.close - assert_equal "a\n\n", r.gets("") + assert_equal "a\n\n", r.gets(""), "[ruby-core:03771]" assert_equal "b\n\n", r.gets("") assert_nil r.gets("") r.close diff --git a/test/ruby/test_path.rb b/test/ruby/test_path.rb index 63dbd07346..18c701f033 100644 --- a/test/ruby/test_path.rb +++ b/test/ruby/test_path.rb @@ -44,13 +44,13 @@ class TestPath < Test::Unit::TestCase assert_equal("//sub", File.expand_path("sub", "//")) end - def test_dirname # [ruby-dev:27738] + def test_dirname if /(bcc|ms)win\d|mingw|cygwin|djgpp|human|emx/ =~ RUBY_PLATFORM # DOSISH_DRIVE_LETTER assert_equal('C:.', File.dirname('C:')) assert_equal('C:.', File.dirname('C:a')) assert_equal('C:.', File.dirname('C:a/')) - assert_equal('C:a', File.dirname('C:a/b')) + assert_equal('C:a', File.dirname('C:a/b'), "[ruby-dev:27738]") assert_equal('C:/', File.dirname('C:/')) assert_equal('C:/', File.dirname('C:/a')) @@ -62,7 +62,7 @@ class TestPath < Test::Unit::TestCase assert_equal('C:/', File.dirname('C://a/')) assert_equal('C:/a', File.dirname('C://a/b')) - assert_equal('C:/', File.dirname('C:///')) + assert_equal('C:/', File.dirname('C:///'), "[ruby-dev:27738]") assert_equal('C:/', File.dirname('C:///a')) assert_equal('C:/', File.dirname('C:///a/')) assert_equal('C:/a', File.dirname('C:///a/b')) @@ -134,7 +134,7 @@ class TestPath < Test::Unit::TestCase end end - def test_basename # [ruby-dev:27766] + def test_basename if /(bcc|ms)win\d|mingw|cygwin|djgpp|human|emx/ =~ RUBY_PLATFORM # DOSISH_DRIVE_LETTER assert_equal('', File.basename('C:')) @@ -194,7 +194,7 @@ class TestPath < Test::Unit::TestCase assert_equal('/', File.basename('//')) assert_equal('/', File.basename('//a')) assert_equal('/', File.basename('//a/')) - assert_equal('/', File.basename('//a/b')) + assert_equal('/', File.basename('//a/b'), "[ruby-dev:27776]") assert_equal('/', File.basename('//a/b/')) assert_equal('c', File.basename('//a/b/c')) diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index 49e9d9284b..b5dbdc936c 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -70,25 +70,21 @@ class TestProc < Test::Unit::TestCase assert_arity(-1) {|*|} end - # [ruby-dev:22592] def m(x) lambda { x } end def test_eq - # [ruby-dev:22592] a = m(1) b = m(2) - assert_not_equal(a, b) - assert_not_equal(a.call, b.call) + assert_not_equal(a, b, "[ruby-dev:22592]") + assert_not_equal(a.call, b.call, "[ruby-dev:22592]") - # [ruby-dev:22599] - assert_not_equal(proc {||}, proc {|x,y|}) + assert_not_equal(proc {||}, proc {|x,y|}, "[ruby-dev:22599]") - # [ruby-dev:22601] a = lambda {|x| lambda {} }.call(1) b = lambda {} - assert_not_equal(a, b) + assert_not_equal(a, b, "[ruby-dev:22601]") end def test_block_par diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb index 018486baae..01b7b904e9 100644 --- a/test/ruby/test_sprintf.rb +++ b/test/ruby/test_sprintf.rb @@ -144,35 +144,30 @@ class TestSprintf < Test::Unit::TestCase end def test_invalid - # [ruby-core:11569] - # Star precision before star width: - assert_raise(ArgumentError) {sprintf("%.**d", 5, 10, 1)} + assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%.**d", 5, 10, 1)} # Precision before flags and width: - assert_raise(ArgumentError) {sprintf("%.5+05d", 5)} - assert_raise(ArgumentError) {sprintf("%.5 5d", 5)} + assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%.5+05d", 5)} + assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%.5 5d", 5)} # Overriding a star width with a numeric one: - assert_raise(ArgumentError) {sprintf("%*1s", 5, 1)} + assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%*1s", 5, 1)} # Width before flags: - assert_raise(ArgumentError) {sprintf("%5+0d", 1)} - assert_raise(ArgumentError) {sprintf("%5 0d", 1)} + assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%5+0d", 1)} + assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%5 0d", 1)} # Specifying width multiple times: - assert_raise(ArgumentError) {sprintf("%50+30+20+10+5d", 5)} - assert_raise(ArgumentError) {sprintf("%50 30 20 10 5d", 5)} + assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%50+30+20+10+5d", 5)} + assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%50 30 20 10 5d", 5)} - # [ruby-core:11570] # Specifying the precision multiple times with negative star arguments: - assert_raise(ArgumentError) {sprintf("%.*.*.*.*f", -1, -1, -1, 5, 1)} + assert_raise(ArgumentError, "[ruby-core:11570]") {sprintf("%.*.*.*.*f", -1, -1, -1, 5, 1)} - # [ruby-core:11571] # Null bytes after percent signs are removed: - assert_equal("%\0x hello", sprintf("%\0x hello")) + assert_equal("%\0x hello", sprintf("%\0x hello"), "[ruby-core:11571]") - # [ruby-core:11573] - assert_raise(ArgumentError) {sprintf("%.25555555555555555555555555555555555555s", "hello")} + assert_raise(ArgumentError, "[ruby-core:11573]") {sprintf("%.25555555555555555555555555555555555555s", "hello")} end end diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index d64fef514e..5e93074e2d 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -126,9 +126,9 @@ class TestSuper < Test::Unit::TestCase end end - def test_define_method # [ruby-core:03856] + def test_define_method a = A.new a.uu(12) - assert_equal("A#tt", a.tt(12)) + assert_equal("A#tt", a.tt(12), "[ruby-core:3856]") end end diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb index 0db6618104..7524b2e7af 100644 --- a/test/ruby/test_system.rb +++ b/test/ruby/test_system.rb @@ -69,7 +69,7 @@ class TestSystem < Test::Unit::TestCase end end - def test_empty_evstr # [ruby-dev:25113] - assert_equal("", eval('"#{}"', nil, __FILE__, __LINE__)) + def test_empty_evstr + assert_equal("", eval('"#{}"', nil, __FILE__, __LINE__), "[ruby-dev:25113]") end end diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index ad9b64ae0e..6177e198d9 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -63,11 +63,11 @@ class TestTime < Test::Unit::TestCase end end - def test_huge_difference # [ruby-dev:22619] + def test_huge_difference if negative_time_t? - assert_equal(Time.at(-0x80000000), Time.at(0x7fffffff) - 0xffffffff) + assert_equal(Time.at(-0x80000000), Time.at(0x7fffffff) - 0xffffffff, "[ruby-dev:22619]") assert_equal(Time.at(-0x80000000), Time.at(0x7fffffff) + (-0xffffffff)) - assert_equal(Time.at(0x7fffffff), Time.at(-0x80000000) + 0xffffffff) + assert_equal(Time.at(0x7fffffff), Time.at(-0x80000000) + 0xffffffff, "[ruby-dev:22619]") assert_equal(Time.at(0x7fffffff), Time.at(-0x80000000) - (-0xffffffff)) end end diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb index 78e678c96f..90f1037db8 100644 --- a/test/socket/test_socket.rb +++ b/test/socket/test_socket.rb @@ -29,7 +29,7 @@ class TestBasicSocket < Test::Unit::TestCase end end - def test_setsockopt # [ruby-dev:25039] + def test_setsockopt s = nil linger = [0, 0].pack("ii") @@ -42,7 +42,7 @@ class TestBasicSocket < Test::Unit::TestCase s = sock assert_equal(0, s.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, linger)) - assert_raise(IOError) { + assert_raise(IOError, "[ruby-dev:25039]") { s.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, val) } end diff --git a/test/socket/test_tcp.rb b/test/socket/test_tcp.rb index ed6391f86e..aa07d96cf0 100644 --- a/test/socket/test_tcp.rb +++ b/test/socket/test_tcp.rb @@ -6,7 +6,7 @@ end class TestTCPSocket < Test::Unit::TestCase - def test_recvfrom # [ruby-dev:24705] + def test_recvfrom assert false, "TODO: doesn't work on mswin32/64" if /mswin/ =~ RUBY_PLATFORM c = s = nil svr = TCPServer.new("localhost", 0) @@ -20,7 +20,7 @@ assert false, "TODO: doesn't work on mswin32/64" if /mswin/ =~ RUBY_PLATFORM } addr = svr.addr sock = TCPSocket.open(addr[2], addr[1]) - assert_raise(RuntimeError, SocketError) { + assert_raise(RuntimeError, SocketError, "[ruby-dev:24705]") { sock.recvfrom(0x10000) } ensure diff --git a/test/socket/test_udp.rb b/test/socket/test_udp.rb index 07fd17a2cb..d515ad4dbb 100644 --- a/test/socket/test_udp.rb +++ b/test/socket/test_udp.rb @@ -6,26 +6,26 @@ end class TestUDPSocket < Test::Unit::TestCase - def test_connect # [ruby-dev:25045] + def test_connect s = UDPSocket.new host = Object.new class << host; self end.send(:define_method, :to_str) { s.close "127.0.0.1" } - assert_raise(IOError) { + assert_raise(IOError, "[ruby-dev:25045]") { s.connect(host, 1) } end - def test_bind # [ruby-dev:25057] + def test_bind s = UDPSocket.new host = Object.new class << host; self end.send(:define_method, :to_str) { s.close "127.0.0.1" } - assert_raise(IOError) { + assert_raise(IOError, "[ruby-dev:25057]") { s.bind(host, 2000) } end diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb index de15ab5508..f0031a5d07 100644 --- a/test/stringio/test_stringio.rb +++ b/test/stringio/test_stringio.rb @@ -15,29 +15,29 @@ class TestStringIO < Test::Unit::TestCase include TestEOF::Seek - def test_truncate # [ruby-dev:24190] + def test_truncate io = StringIO.new("") io.puts "abc" io.truncate(0) io.puts "def" - assert_equal("\0\0\0\0def\n", io.string) + assert_equal("\0\0\0\0def\n", io.string, "[ruby-dev:24190]") end - def test_seek_beyond_eof # [ruby-dev:24194] + def test_seek_beyond_eof io = StringIO.new n = 100 io.seek(n) io.print "last" - assert_equal("\0" * n + "last", io.string) + assert_equal("\0" * n + "last", io.string, "[ruby-dev:24194]") end - def test_overwrite # [ruby-core:03836] + def test_overwrite stringio = StringIO.new responses = ['', 'just another ruby', 'hacker'] responses.each do |resp| stringio.puts(resp) stringio.rewind end - assert_equal("hacker\nother ruby\n", stringio.string) + assert_equal("hacker\nother ruby\n", stringio.string, "[ruby-core:3836]") end end diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb index a159901ea6..0fe031bdee 100644 --- a/test/uri/test_common.rb +++ b/test/uri/test_common.rb @@ -12,7 +12,6 @@ class TestCommon < Test::Unit::TestCase end def test_extract - # ruby-list:36086 assert_equal(['http://example.com'], URI.extract('http://example.com')) assert_equal(['http://example.com'], @@ -20,9 +19,9 @@ class TestCommon < Test::Unit::TestCase assert_equal(['http://example.com/foo)'], URI.extract('(http://example.com/foo)')) assert_equal(['http://example.jphttp://example.jp'], - URI.extract('http://example.jphttp://example.jp')) + URI.extract('http://example.jphttp://example.jp'), "[ruby-list:36086]") assert_equal(['http://example.jphttp://example.jp'], - URI.extract('http://example.jphttp://example.jp', ['http'])) + URI.extract('http://example.jphttp://example.jp', ['http']), "[ruby-list:36086]") assert_equal(['http://', 'mailto:'].sort, URI.extract('ftp:// http:// mailto: https://', ['http', 'mailto']).sort) # reported by Doug Kearns diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb index 8ac0149c60..6661b4a5d2 100644 --- a/test/uri/test_generic.rb +++ b/test/uri/test_generic.rb @@ -121,11 +121,10 @@ class URI::TestGeneric < Test::Unit::TestCase assert_kind_of(URI::Generic, url) # 9 - # [ruby-dev:25667] url = URI.parse('ftp://:pass@localhost/') - assert_equal('', url.user) + assert_equal('', url.user, "[ruby-dev:25667]") assert_equal('pass', url.password) - assert_equal(':pass', url.userinfo) + assert_equal(':pass', url.userinfo, "[ruby-dev:25667]") url = URI.parse('ftp://user@localhost/') assert_equal('user', url.user) assert_equal(nil, url.password) @@ -152,9 +151,8 @@ class URI::TestGeneric < Test::Unit::TestCase assert_equal(URI.parse('http://foo/baz'), u3 + '/baz') assert_equal(URI.parse('http://foo/baz'), u4 + '/baz') - # from [ruby-dev:11508] Re: uri url = URI.parse('http://hoge/a.html') + 'b.html' - assert_equal('http://hoge/b.html', url.to_s) + assert_equal('http://hoge/b.html', url.to_s, "[ruby-dev:11508]") # reported by Mr. Kubota url = URI.parse('http://a/b') + 'http://x/y' @@ -171,15 +169,13 @@ class URI::TestGeneric < Test::Unit::TestCase assert(nil != u.merge!("../baz")) assert_equal('http://foo/baz', u.to_s) - # [ruby-dev:23628] u0 = URI.parse('mailto:foo@example.com') u1 = URI.parse('mailto:foo@example.com#bar') - assert_equal(uri_to_ary(u0 + '#bar'), uri_to_ary(u1)) + assert_equal(uri_to_ary(u0 + '#bar'), uri_to_ary(u1), "[ruby-dev:23628]") - # [ruby-list:39838] u0 = URI.parse('http://www.example.com/') u1 = URI.parse('http://www.example.com/foo/..') + './' - assert_equal(u0, u1) + assert_equal(u0, u1, "[ruby-list:39838]") u0 = URI.parse('http://www.example.com/foo/') u1 = URI.parse('http://www.example.com/foo/bar/..') + './' assert_equal(u0, u1) @@ -193,11 +189,10 @@ class URI::TestGeneric < Test::Unit::TestCase u1 = URI.parse('http://www.example.com/foo/bar/baz/../..') + './' assert_equal(u0, u1) - # [ruby-list:39844] u = URI.parse('http://www.example.com/') u0 = u + './foo/' u1 = u + './foo/bar/..' - assert_equal(u0, u1) + assert_equal(u0, u1, "[ruby-list:39844]") u = URI.parse('http://www.example.com/') u0 = u + './' u1 = u + './foo/bar/../..' @@ -649,10 +644,9 @@ class URI::TestGeneric < Test::Unit::TestCase assert_equal(URI.parse('http://foo/hoge'), URI.join('http://foo', 'bar/baz', '/hoge')) end - # ruby-dev:16728 def test_set_component uri = URI.parse('http://foo:bar@baz') - assert_equal('oof', uri.user = 'oof') + assert_equal('oof', uri.user = 'oof', "[ruby-dev:16728]") assert_equal('http://oof:bar@baz', uri.to_s) assert_equal('rab', uri.password = 'rab') assert_equal('http://oof:rab@baz', uri.to_s) diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index 54706099d9..493f717e4e 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -14,7 +14,7 @@ if defined? Zlib assert_equal("", Zlib::GzipReader.new(StringIO.new(D0)).read(0)) end - def test_ungetc # [ruby-dev:24060] + def test_ungetc s = "" w = Zlib::GzipWriter.new(StringIO.new(s)) w << (1...1000).to_a.inspect @@ -22,14 +22,14 @@ if defined? Zlib r = Zlib::GzipReader.new(StringIO.new(s)) r.read(100) r.ungetc ?a - assert_nothing_raised { + assert_nothing_raised("[ruby-dev:24060]") { r.read(100) r.read r.close } end - def test_ungetc_paragraph # [ruby-dev:24065] + def test_ungetc_paragraph s = "" w = Zlib::GzipWriter.new(StringIO.new(s)) w << "abc" @@ -37,7 +37,7 @@ if defined? Zlib r = Zlib::GzipReader.new(StringIO.new(s)) r.ungetc ?\n assert_equal("abc", r.gets("")) - assert_nothing_raised { + assert_nothing_raised("[ruby-dev:24065]") { r.read r.close } @@ -46,12 +46,10 @@ if defined? Zlib class TestZlibGzipWriter < Test::Unit::TestCase def test_invalid_new - # [ruby-dev:23228] - assert_raise(NoMethodError) { Zlib::GzipWriter.new(nil).close } - # [ruby-dev:23344] - assert_raise(NoMethodError) { Zlib::GzipWriter.new(true).close } - assert_raise(NoMethodError) { Zlib::GzipWriter.new(0).close } - assert_raise(NoMethodError) { Zlib::GzipWriter.new(:hoge).close } + assert_raise(NoMethodError, "[ruby-dev:23228]") { Zlib::GzipWriter.new(nil).close } + assert_raise(NoMethodError, "[ruby-dev:23344]") { Zlib::GzipWriter.new(true).close } + assert_raise(NoMethodError, "[ruby-dev:23344]") { Zlib::GzipWriter.new(0).close } + assert_raise(NoMethodError, "[ruby-dev:23344]") { Zlib::GzipWriter.new(:hoge).close } end end end -- cgit v1.2.3