mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_dir.rb (TestDir::setup): ?c now makes a string.
* lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::initialize): initialize @workdir to stop warning. * lib/drb/drb.rb (DRb::DRbServer::InvokeMethod::perform_without_block): replace funcall by send!. other files in the distribution as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
99ab1fed49
commit
4e183b11ac
12 changed files with 35 additions and 22 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
Fri Aug 24 18:42:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* test/ruby/test_dir.rb (TestDir::setup): ?c now makes a string.
|
||||||
|
|
||||||
|
* lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::initialize):
|
||||||
|
initialize @workdir to stop warning.
|
||||||
|
|
||||||
|
Fri Aug 24 18:30:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/drb/drb.rb (DRb::DRbServer::InvokeMethod::perform_without_block):
|
||||||
|
replace funcall by send!. other files in the distribution as well.
|
||||||
|
|
||||||
Fri Aug 24 17:06:56 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Fri Aug 24 17:06:56 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (rb_f_send_bang): abandon the name funcall for private
|
* eval.c (rb_f_send_bang): abandon the name funcall for private
|
||||||
|
|
|
@ -1553,7 +1553,7 @@ module DRb
|
||||||
end
|
end
|
||||||
ary.collect(&@obj)[0]
|
ary.collect(&@obj)[0]
|
||||||
else
|
else
|
||||||
@obj.funcall(@msg_id, *@argv)
|
@obj.send!(@msg_id, *@argv)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1231,7 +1231,7 @@ module Net
|
||||||
|
|
||||||
class RawData # :nodoc:
|
class RawData # :nodoc:
|
||||||
def send_data(imap)
|
def send_data(imap)
|
||||||
imap.funcall(:put_string, @data)
|
imap.send!(:put_string, @data)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -1243,7 +1243,7 @@ module Net
|
||||||
|
|
||||||
class Atom # :nodoc:
|
class Atom # :nodoc:
|
||||||
def send_data(imap)
|
def send_data(imap)
|
||||||
imap.funcall(:put_string, @data)
|
imap.send!(:put_string, @data)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -1255,7 +1255,7 @@ module Net
|
||||||
|
|
||||||
class QuotedString # :nodoc:
|
class QuotedString # :nodoc:
|
||||||
def send_data(imap)
|
def send_data(imap)
|
||||||
imap.funcall(:send_quoted_string, @data)
|
imap.send!(:send_quoted_string, @data)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -1267,7 +1267,7 @@ module Net
|
||||||
|
|
||||||
class Literal # :nodoc:
|
class Literal # :nodoc:
|
||||||
def send_data(imap)
|
def send_data(imap)
|
||||||
imap.funcall(:send_literal, @data)
|
imap.send!(:send_literal, @data)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -1279,7 +1279,7 @@ module Net
|
||||||
|
|
||||||
class MessageSet # :nodoc:
|
class MessageSet # :nodoc:
|
||||||
def send_data(imap)
|
def send_data(imap)
|
||||||
imap.funcall(:put_string, format_internal(@data))
|
imap.send!(:put_string, format_internal(@data))
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -719,7 +719,7 @@ module Net
|
||||||
def authenticate(user, secret, authtype = DEFAULT_AUTH_TYPE)
|
def authenticate(user, secret, authtype = DEFAULT_AUTH_TYPE)
|
||||||
check_auth_method authtype
|
check_auth_method authtype
|
||||||
check_auth_args user, secret
|
check_auth_args user, secret
|
||||||
funcall auth_method(authtype), user, secret
|
send! auth_method(authtype), user, secret
|
||||||
end
|
end
|
||||||
|
|
||||||
def auth_plain(user, secret)
|
def auth_plain(user, secret)
|
||||||
|
|
|
@ -81,6 +81,7 @@ module Test
|
||||||
@filters = []
|
@filters = []
|
||||||
@to_run = []
|
@to_run = []
|
||||||
@output_level = UI::NORMAL
|
@output_level = UI::NORMAL
|
||||||
|
@workdir = false
|
||||||
yield(self) if(block_given?)
|
yield(self) if(block_given?)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ class TestPathname < Test::Unit::TestCase
|
||||||
if RUBY_VERSION < "1.9"
|
if RUBY_VERSION < "1.9"
|
||||||
FUNCALL = :__send__
|
FUNCALL = :__send__
|
||||||
else
|
else
|
||||||
FUNCALL = :funcall
|
FUNCALL = :send!
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.define_assertion(name, &block)
|
def self.define_assertion(name, &block)
|
||||||
|
|
|
@ -56,7 +56,7 @@ class TestAlias < Test::Unit::TestCase
|
||||||
d = lambda {
|
d = lambda {
|
||||||
$SAFE = 4
|
$SAFE = 4
|
||||||
dclass = Class.new(C)
|
dclass = Class.new(C)
|
||||||
dclass.funcall(:alias_method, :mm, :m)
|
dclass.send!(:alias_method, :mm, :m)
|
||||||
dclass.new
|
dclass.new
|
||||||
}.call
|
}.call
|
||||||
assert_raise(SecurityError) { d.mm }
|
assert_raise(SecurityError) { d.mm }
|
||||||
|
|
|
@ -10,10 +10,10 @@ class TestDir < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
Dir.mkdir(ROOT)
|
Dir.mkdir(ROOT)
|
||||||
for i in ?a..?z
|
for i in ?a..?z
|
||||||
if i % 2 == 0
|
if i.ord % 2 == 0
|
||||||
FileUtils.touch(File.join(ROOT, i.chr))
|
FileUtils.touch(File.join(ROOT, i))
|
||||||
else
|
else
|
||||||
FileUtils.mkdir(File.join(ROOT, i.chr))
|
FileUtils.mkdir(File.join(ROOT, i))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -31,7 +31,7 @@ class TestDir < Test::Unit::TestCase
|
||||||
break unless name = dir.read
|
break unless name = dir.read
|
||||||
cache << [pos, name]
|
cache << [pos, name]
|
||||||
end
|
end
|
||||||
for x,y in cache.sort_by {|x| x[0] % 3 } # shuffle
|
for x,y in cache.sort_by {|z| z[0] % 3 } # shuffle
|
||||||
dir.seek(x)
|
dir.seek(x)
|
||||||
assert_equal(y, dir.read)
|
assert_equal(y, dir.read)
|
||||||
end
|
end
|
||||||
|
|
|
@ -124,7 +124,7 @@ class TestEval < Test::Unit::TestCase
|
||||||
obj.class.class_variable_set :@@cvar, 13
|
obj.class.class_variable_set :@@cvar, 13
|
||||||
# Use same value with env. See also test_instance_variable_cvar.
|
# Use same value with env. See also test_instance_variable_cvar.
|
||||||
obj.class.const_set :Const, 15 unless obj.class.const_defined?(:Const)
|
obj.class.const_set :Const, 15 unless obj.class.const_defined?(:Const)
|
||||||
funcall mid, obj
|
send! mid, obj
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ class TestEval < Test::Unit::TestCase
|
||||||
assert_nothing_raised {
|
assert_nothing_raised {
|
||||||
def temporally_method_for_test_eval_and_define_method(&block)
|
def temporally_method_for_test_eval_and_define_method(&block)
|
||||||
lambda {
|
lambda {
|
||||||
class << Object.new; self end.funcall(:define_method, :zzz, &block)
|
class << Object.new; self end.send!(:define_method, :zzz, &block)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
v = eval("temporally_method_for_test_eval_and_define_method {}")
|
v = eval("temporally_method_for_test_eval_and_define_method {}")
|
||||||
|
|
|
@ -50,7 +50,7 @@ class TestRubyPrimitive < Test::Unit::TestCase
|
||||||
assert_equal 3, A::B::C::Const
|
assert_equal 3, A::B::C::Const
|
||||||
assert_equal 3, A::B::C.new.const
|
assert_equal 3, A::B::C.new.const
|
||||||
assert_equal 1, ::TestRubyPrimitive::A::Const
|
assert_equal 1, ::TestRubyPrimitive::A::Const
|
||||||
A::B::C.funcall(:remove_const, :Const)
|
A::B::C.send!(:remove_const, :Const)
|
||||||
assert_equal 2, A::B::C.new.const
|
assert_equal 2, A::B::C.new.const
|
||||||
assert_raise(TypeError) {
|
assert_raise(TypeError) {
|
||||||
C::CONST
|
C::CONST
|
||||||
|
|
|
@ -19,7 +19,7 @@ class TestBasicSocket < Test::Unit::TestCase
|
||||||
n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR)
|
n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR)
|
||||||
assert_equal([0].pack("i"), n)
|
assert_equal([0].pack("i"), n)
|
||||||
val = Object.new
|
val = Object.new
|
||||||
class << val; self end.funcall(:define_method, :to_int) {
|
class << val; self end.send!(:define_method, :to_int) {
|
||||||
s.close
|
s.close
|
||||||
Socket::SO_TYPE
|
Socket::SO_TYPE
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class TestBasicSocket < Test::Unit::TestCase
|
||||||
linger = [0, 0].pack("ii")
|
linger = [0, 0].pack("ii")
|
||||||
|
|
||||||
val = Object.new
|
val = Object.new
|
||||||
class << val; self end.funcall(:define_method, :to_str) {
|
class << val; self end.send!(:define_method, :to_str) {
|
||||||
s.close
|
s.close
|
||||||
linger
|
linger
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ class TestBasicSocket < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
val = Object.new
|
val = Object.new
|
||||||
class << val; self end.funcall(:define_method, :to_int) {
|
class << val; self end.send!(:define_method, :to_int) {
|
||||||
s.close
|
s.close
|
||||||
Socket::SO_LINGER
|
Socket::SO_LINGER
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ class TestBasicSocket < Test::Unit::TestCase
|
||||||
def test_listen
|
def test_listen
|
||||||
s = nil
|
s = nil
|
||||||
log = Object.new
|
log = Object.new
|
||||||
class << log; self end.funcall(:define_method, :to_int) {
|
class << log; self end.send!(:define_method, :to_int) {
|
||||||
s.close
|
s.close
|
||||||
2
|
2
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ class TestUDPSocket < Test::Unit::TestCase
|
||||||
def test_connect # [ruby-dev:25045]
|
def test_connect # [ruby-dev:25045]
|
||||||
s = UDPSocket.new
|
s = UDPSocket.new
|
||||||
host = Object.new
|
host = Object.new
|
||||||
class << host; self end.funcall(:define_method, :to_str) {
|
class << host; self end.send!(:define_method, :to_str) {
|
||||||
s.close
|
s.close
|
||||||
"127.0.0.1"
|
"127.0.0.1"
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class TestUDPSocket < Test::Unit::TestCase
|
||||||
def test_bind # [ruby-dev:25057]
|
def test_bind # [ruby-dev:25057]
|
||||||
s = UDPSocket.new
|
s = UDPSocket.new
|
||||||
host = Object.new
|
host = Object.new
|
||||||
class << host; self end.funcall(:define_method, :to_str) {
|
class << host; self end.send!(:define_method, :to_str) {
|
||||||
s.close
|
s.close
|
||||||
"127.0.0.1"
|
"127.0.0.1"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue