aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_proc.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-12-31 15:02:22 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-12-31 15:02:22 +0000
commita3e1b1ce7ed7e7ffac23015fc2fde56511b30681 (patch)
tree7b725552a9a4ded93849ca2faab1b257f7761790 /test/ruby/test_proc.rb
parent3e7566d8fb5138bb9cd647e5fdefc54fc9803509 (diff)
downloadruby-a3e1b1ce7ed7e7ffac23015fc2fde56511b30681.tar.gz
* Merge YARV
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_proc.rb')
-rw-r--r--test/ruby/test_proc.rb21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index aaeb189e27..f293bbc1a7 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -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