diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-12-31 15:02:22 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-12-31 15:02:22 +0000 |
| commit | 4ef881bd15c9c4e2e9b20da2c091e80d4d530119 (patch) | |
| tree | 7b725552a9a4ded93849ca2faab1b257f7761790 /test/ruby/test_proc.rb | |
| parent | 182520b0acc5eea4da52bc8734dc5e3280ce5f94 (diff) | |
| download | ruby-4ef881bd15c9c4e2e9b20da2c091e80d4d530119.tar.gz ruby-4ef881bd15c9c4e2e9b20da2c091e80d4d530119.tar.xz ruby-4ef881bd15c9c4e2e9b20da2c091e80d4d530119.zip | |
* Merge YARV
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_proc.rb')
| -rw-r--r-- | test/ruby/test_proc.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index aaeb189e2..f293bbc1a 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 |
