1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/io/nonblock/test_flush.rb (TestIONonblock#test_flush): write

operation ignores EAGAIN.

* test/ruby/test_super.rb (TestSuper#test_define_method): test for
  super from proc.  [ruby-core:03856]

* test/socket/test_tcp.rb (TestTCPSocket#test_recvfrom): make
  execution order more precise.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2004-12-07 18:26:12 +00:00
parent d5b434088a
commit 807a93be08
3 changed files with 30 additions and 5 deletions

View file

@ -23,7 +23,7 @@ class TestIONonblock < Test::Unit::TestCase
end end
} }
assert_raise(IOError) {w.flush} assert_raise(IOError) {w.flush}
t.join assert_nothing_raised {t.join}
assert_equal("b", result) assert_equal(4097, result.size)
end end
end if IO.method_defined?(:nonblock) end if IO.method_defined?(:nonblock)

View file

@ -65,4 +65,24 @@ class TestSuper < Test::Unit::TestCase
assert_equal([1,2,3], Array4.new.array(1, 2, 3)) assert_equal([1,2,3], Array4.new.array(1, 2, 3))
assert_equal([1,2,3,4], Array4.new.array(1, 2, 3, 4)) assert_equal([1,2,3,4], Array4.new.array(1, 2, 3, 4))
end end
class A
def tt(aa)
"A#tt"
end
def uu(a)
class << self
define_method(:tt) do |sym|
super
end
end
end
end
def test_define_method # [ruby-core:03856]
a = A.new
a.uu(12)
assert_raise(RuntimeError) {a.tt(12)}
end
end end

View file

@ -7,17 +7,22 @@ end
class TestTCPSocket < Test::Unit::TestCase class TestTCPSocket < Test::Unit::TestCase
def test_recvfrom # [ruby-dev:24705] def test_recvfrom # [ruby-dev:24705]
c = s = nil
svr = TCPServer.new("localhost", 0) svr = TCPServer.new("localhost", 0)
Thread.new { Thread.new {
svr.accept.print("x"*0x1000) c = svr.accept
Thread.pass until s
c.print("x"*0x1000)
} }
addr = svr.addr addr = svr.addr
sock = TCPSocket.open(addr[2], addr[1]) sock = TCPSocket.open(addr[2], addr[1])
Thread.new { Thread.new {
Thread.pass Thread.pass until c
Thread.critical = true
ObjectSpace.each_object(String) {|s| ObjectSpace.each_object(String) {|s|
s.replace "a" if s.length == 0x10000 s.replace "a" if s.length == 0x10000 and !s.frozen?
} }
Thread.critical = false
} }
assert_raise(RuntimeError, SocketError) { assert_raise(RuntimeError, SocketError) {
sock.recvfrom(0x10000) sock.recvfrom(0x10000)