diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-10 22:57:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-10 22:57:38 +0000 |
commit | 8f5c64482a6f3ea56ec91e44dd3a21876a2ebf6a (patch) | |
tree | 122644a531c4cc8bc627a234e44811ccac84edd7 /test/ruby | |
parent | 80084d5e72a542e663cdb49cf9a917b374fdf951 (diff) | |
download | ruby-8f5c64482a6f3ea56ec91e44dd3a21876a2ebf6a.tar.gz ruby-8f5c64482a6f3ea56ec91e44dd3a21876a2ebf6a.tar.xz ruby-8f5c64482a6f3ea56ec91e44dd3a21876a2ebf6a.zip |
* test/ruby/test_iterator.rb (test_block_passing): yield in method
argument behaves differently. [ruby-dev:26274]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_iterator.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb index f3c2201e0..5c2ef183a 100644 --- a/test/ruby/test_iterator.rb +++ b/test/ruby/test_iterator.rb @@ -189,6 +189,14 @@ class TestIterator < Test::Unit::TestCase assert(!m2()) end + def m3(var, &block) + m(yield(var), &block) + end + + def test_block_passing + assert_equal(100, m3(10) {|x|x*x}) + end + class C include Enumerable def initialize |