mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* Merge YARV
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3e7566d8fb
commit
a3e1b1ce7e
233 changed files with 46004 additions and 13653 deletions
|
@ -71,6 +71,7 @@ class TestProc < Test::Unit::TestCase
|
|||
def m(x)
|
||||
lambda { x }
|
||||
end
|
||||
|
||||
def test_eq
|
||||
# [ruby-dev:22592]
|
||||
a = m(1)
|
||||
|
@ -88,8 +89,9 @@ class TestProc < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_block_par
|
||||
assert_equal(10, Proc.new{|&b| b.call(10)}.call {|x| x})
|
||||
assert_equal(12, Proc.new{|a,&b| b.call(a)}.call(12) {|x| x})
|
||||
assert false, "TODO: block parameter |&b| not supported"
|
||||
# assert_equal(10, Proc.new{|&b| b.call(10)}.call {|x| x})
|
||||
# assert_equal(12, Proc.new{|a,&b| b.call(a)}.call(12) {|x| x})
|
||||
end
|
||||
|
||||
def test_safe
|
||||
|
@ -122,4 +124,19 @@ class TestProc < Test::Unit::TestCase
|
|||
assert_equal(safe + 1, proc {x.method(:inc).to_proc.call; $SAFE}.call)
|
||||
assert_equal(safe, $SAFE)
|
||||
end
|
||||
|
||||
def m2
|
||||
"OK"
|
||||
end
|
||||
|
||||
def block
|
||||
method(:m2).to_proc
|
||||
end
|
||||
|
||||
# [yarv-dev:777] block made by Method#to_proc
|
||||
def test_method_to_proc
|
||||
b = block()
|
||||
assert_equal "OK", b.call
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue