mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Move Kernel#__send__ test to core from mruby-metaprog
This commit is contained in:
@@ -1,17 +1,3 @@
|
||||
assert('Kernel#__send__', '15.3.1.3.4') do
|
||||
# test with block
|
||||
l = __send__(:lambda) do
|
||||
true
|
||||
end
|
||||
|
||||
assert_true l.call
|
||||
assert_equal Proc, l.class
|
||||
# test with argument
|
||||
assert_true __send__(:respond_to?, :nil?)
|
||||
# test without argument and without block
|
||||
assert_equal String, __send__(:to_s).class
|
||||
end
|
||||
|
||||
assert('Kernel#send', '15.3.1.3.44') do
|
||||
# test with block
|
||||
l = send(:lambda) do
|
||||
|
||||
@@ -88,6 +88,20 @@ assert('Kernel#__id__', '15.3.1.3.3') do
|
||||
assert_equal Fixnum, __id__.class
|
||||
end
|
||||
|
||||
assert('Kernel#__send__', '15.3.1.3.4') do
|
||||
# test with block
|
||||
l = __send__(:lambda) do
|
||||
true
|
||||
end
|
||||
|
||||
assert_true l.call
|
||||
assert_equal Proc, l.class
|
||||
# test with argument
|
||||
assert_true __send__(:respond_to?, :nil?)
|
||||
# test without argument and without block
|
||||
assert_equal String, __send__(:to_s).class
|
||||
end
|
||||
|
||||
assert('Kernel#block_given?', '15.3.1.3.6') do
|
||||
def bg_try(&b)
|
||||
if block_given?
|
||||
|
||||
Reference in New Issue
Block a user